Arama butonu kod hatasi

Katılım
7 Mart 2007
Mesajlar
60
Excel Vers. ve Dili
Excel 2003 almanca
Saygilar UserForma ekledigim Arama butonunda TextBox ve ComboBox lara aradigim kisinin bilgisini girdigimde TextBox lara bilgiler gelirken ComboBox lara bilgi almiyor konturol ede bilirmisiniz simdiden tesekurler
 
Katılım
7 Mart 2007
Mesajlar
60
Excel Vers. ve Dili
Excel 2003 almanca
Saygilar arkadaslar burda ne gibi bir duzenleme yapmaliyim combox lara bilgi
almam icin

HTML:
Private Sub CommandButton1_Click()   ' Arama
Dim rng As Range
Dim strFirst As String
Dim vtmp() As Long
Dim tntC As Integer

If Len(Trim(TextBoxSuch)) = 0 Then Exit Sub
ListBox1.Clear
For IntC = 1 To 15
   Controls("TextBox" & IntC) = ""
   Controls("ComboBox" & IntC) = ""
Next
ReDim vtmp(0)

With Sheets("Tabelle1")
   Set rng = .Range("B:F").Find(What:=TextBoxSuch, Lookat:=xlPart)
   If Not rng Is Nothing Then
      strFirst = rng.Address
      
      Do
         If Not (IsNumeric(Application.Match(rng.Row, vtmp, 0))) Then
            ReDim Preserve vtmp(UBound(vtmp) + 1)
            vtmp(UBound(vtmp)) = rng.Row
            ListBox1.AddItem .Cells(rng.Row, 3)
            ListBox1.List(ListBox1.ListCount - 1, 1) = .Cells(rng.Row, 4)
            ListBox1.List(ListBox1.ListCount - 1, 2) = .Cells(rng.Row, 7)
            ListBox1.List(ListBox1.ListCount - 1, 3) = .Cells(rng.Row, 2)
            ListBox1.List(ListBox1.ListCount - 1, 4) = rng.Row
         End If
         Set rng = .Range("B:F").FindNext(rng)
      
      Loop While Not rng Is Nothing And rng.Address <> strFirst
   End If
End With

If ListBox1.ListCount > 0 Then
   ListBox1.ListIndex = 0
Else
   ListBox1.AddItem "Kein Eintrag!"
End If
Set rng = Nothing
End Sub
 
Üst