Gruppe
Dialog
Problem
Über eine TextBox sollen ListBox-Einträge je nach Buchstabeneingabe selektiert werden.
ClassModule: frmMonths
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub txtMonth_Change()
Dim iRow As Integer
For iRow = 0 To lstMonths.ListCount - 1
If LCase(Left(lstMonths.List(iRow), _
txtMonth.TextLength)) = LCase(txtMonth.Text) Then
lstMonths.ListIndex = iRow
Exit For
Else
lstMonths.ListIndex = -1
End If
Next iRow
End Sub
Private Sub UserForm_Initialize()
Dim iRow As Integer
For iRow = 1 To 12
lstMonths.AddItem Format(DateSerial(1, iRow, 1), "mmmm")
Next iRow
End Sub
StandardModule: Modul1
Sub DialogAufruf()
frmMonths.Show
End Sub