Gruppe
Dialog
Problem
Über UserForm-ComboBoxes werden Name und Vorname gesucht. Die Fundzeile wird markiert.
ClassModule: frmNames
Private Sub cboNames_Change()
Call selectname
End Sub
Private Sub cboSurenames_Change()
Call selectname
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
cboNames.List = Range("A1").CurrentRegion.Columns(1).Value
cboSurenames.List = Range("A1").CurrentRegion.Columns(2).Value
cboNames.ListIndex = 0
cboSurenames.ListIndex = 0
End Sub
Private Sub selectname()
Dim iRow As Integer
iRow = 1
Do Until IsEmpty(Cells(iRow, 1))
If Cells(iRow, 1).Value = cboNames.Value And _
Cells(iRow, 2).Value = cboSurenames.Value Then
Rows(iRow).Select
End If
iRow = iRow + 1
Loop
End Sub
StandardModule: Modul1
Sub CallForm()
frmNames.Show
End Sub