ich möchte mit einer Combobox eine Spalte durchsuchen. Bei Eingabe von einer Zahl gefolgt von einem Buchstaben ist alles ok. Eine reine Zahlenreihe blendet die eingebaute MsgBox ein. Mit Hilfe des Internets habe ich mir folgendes gebastelt. Was habe ich falsch gemacht?
VG René
Private Sub ComboBox1_Change()
Application.ScreenUpdating = False
Set Rng = Worksheets("Tabelle1").Columns(4) _
.Find(what:=ComboBox1.Text, LookAt:=xlWhole, LookIn:=xlValues)
If Not Rng Is Nothing Then
Application.Goto Rng
Else
MsgBox "Suchbegriff wurde nicht gefunden!"
End If
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Set wks = ActiveSheet
iRowT = 1
iRowL = Cells(Rows.Count, 4).End(xlUp).Row
Workbooks.Add
For iRow = 3 To iRowL
vRow = Application.Match(wks.Cells(iRow, 4).Value, Columns(1), 0)
If IsError(vRow) Then
iRowT = iRowT + 1
Cells(iRowT, 1).Value = wks.Cells(iRow, 4).Value
End If
Next iRow
Range("A1").CurrentRegion.Sort _
key1:=Range("A1"), order1:=xlAscending, Header:=xlNo
With ComboBox1
.List = Range("A1").CurrentRegion.Value
If .ListCount > 0 Then .ListIndex = -1
End With
ActiveWorkbook.Close savechanges:=False
End Sub