|  
                                             
	Hallo! 
	Habe folgenden Code in einer Userform liegen! 
	Es sind vir Combobxen die voneinander anhängig sind. 
	Nun möchte ich gerne das ich einen Abgleich alla SVERWEIS habe der die ersten ComboBoxen überprüft 
	und in der Richtigen Zeile aus der Spalte 5 den Wert in dem Label dar stellt. 
	Im Moment ist es so, das die einzelnen Werte nur zusammen im Label angezeigt werden. 
	 
	Da komme ich aber nicht mit klar! 
	  
	Kann mir da jemand weiterhelfen? 
	  
	Gruß Frank 
Option Explicit
'Modulweite Variablen deklarieren
Const C_mstrDatenblatt As String = "Tabelle1"
Const C_mstrZielblatt As String = "Tabelle2"
Dim mobjDic As Object
Dim mlngLast As Long
Dim sVar
Dim variable As String
Dim mlngZ As Long
Private Sub ComboBox1_Enter()
'1. ComboBox
Set mobjDic = CreateObject("Scripting.Dictionary")
 
For mlngZ = 2 To mlngLast
  mobjDic(Worksheets(C_mstrDatenblatt).Cells(mlngZ, 1).Value) = 0
Next
 
Me.ComboBox1.List = mobjDic.keys
Set mobjDic = Nothing
End Sub
 
Private Sub ComboBox2_Enter()
'2. ComboBox
Set mobjDic = CreateObject("Scripting.Dictionary")
With Worksheets(C_mstrDatenblatt)
  For mlngZ = 2 To mlngLast
    If .Cells(mlngZ, 1).Value = Me.ComboBox1.Value Then
      mobjDic(.Cells(mlngZ, 2).Value) = 0
    End If
  Next
End With
 
Me.ComboBox2.List = mobjDic.keys
Set mobjDic = Nothing
End Sub
Private Sub ComboBox3_Enter()
'3. ComboBox
Set mobjDic = CreateObject("Scripting.Dictionary")
With Worksheets(C_mstrDatenblatt)
  For mlngZ = 2 To mlngLast
    If .Cells(mlngZ, 2).Value = Me.ComboBox2.Value Then
      mobjDic(.Cells(mlngZ, 3).Value) = 0
    End If
  Next
End With
 
Me.ComboBox3.List = mobjDic.keys
Set mobjDic = Nothing
End Sub
Private Sub ComboBox4_Enter()
'4. ComboBox
Me.ComboBox4.Clear
With Worksheets(C_mstrDatenblatt)
  For mlngZ = 2 To mlngLast
  
    If .Cells(mlngZ, 1).Value = Me.ComboBox1.Value And .Cells(mlngZ, 2).Value = Me.ComboBox2.Value And .Cells(mlngZ, 3).Value = Me.ComboBox3.Value Then
      Me.ComboBox4.AddItem .Cells(mlngZ, 4).Value
    End If
  Next
End With
End Sub
Private Sub ComboBox4_Change()
Label1.Caption = ComboBox1 & " " & ComboBox2 & " " & ComboBox3 & " " & ComboBox4
End Sub
Private Sub CommandButton1_Click()
'Userform schliessen
Unload Me
End Sub
 
Private Sub CommandButton2_Click()
'Ausgewählte Daten in Tabelle 2 übertragen und Felder löschen
With Worksheets(C_mstrZielblatt)
  .Cells(.Cells(Rows.Count, 1).End(xlUp).Row + 1, 1).Value = Me.ComboBox1.Value
  Me.ComboBox1.Clear
  .Cells(.Cells(Rows.Count, 2).End(xlUp).Row + 1, 2).Value = Me.ComboBox2.Value
  Me.ComboBox2.Clear
  .Cells(.Cells(Rows.Count, 3).End(xlUp).Row + 1, 3).Value = Me.ComboBox3.Value
  Me.ComboBox3.Clear
  .Cells(.Cells(Rows.Count, 4).End(xlUp).Row + 1, 4).Value = Me.ComboBox4.Value
  Me.ComboBox4 = " "
  Label1.Caption = " "
End With
End Sub
 
Private Sub UserForm_Initialize()
'Bei Start der Userform wird die unterste Zeile in Spalte A im Datenblatt ermittelt
mlngLast = Worksheets(C_mstrDatenblatt).Cells(Rows.Count, 1).End(xlUp).Row
End Sub
	  
     |