ich habe eine UF mit ListBox und ComboBox.
in der UF:
Dim LoLetzte2 As Long
Dim lngI As Long
LoLetzte2 = Sheets(sBlattname).Cells(Rows.Count, 1).End(xlUp).Row
Me.ListBox1.RowSource = sBlattname & "!A3:N" & LoLetzte2
ComboBox1.AddItem "Alle anzeigen"
For lngI = 0 To ListBox1.ListCount
ComboBox1.AddItem ListBox1.Column(2, lngI)
Next
ComboBox1.ListIndex = 0
Hier das Makro:
Private Sub ComboBox1_Change()
Dim LoLetzte1 As Long
'LoLetzte1 = Sheets("Datenbank").Cells(Rows.Count, 1).End(xlUp).Row
If ComboBox1.ListIndex > 0 Then
Me.ListBox1.RowSource = "Häuser" & "!A" & ComboBox1.ListIndex + 2 & ":N" & ComboBox1. _
ListIndex + 2
ActiveSheet.Range("O1") = ComboBox1.ListIndex
ActiveSheet.Range("$A$2:$N$65000").AutoFilter Field:=1, Criteria1:=ActiveSheet.Range("O1") _
_
'"mg1"
Else
'MsgBox "ww"
If ActiveSheet.AutoFilterMode Then
Selection.AutoFilter
End If
Call UserForm_Activate
End If
End Sub
Ich möchte gern das die Spalte "B" gefiltert wird, krieg es nicht hin,
WARUM ?
gruß
philipp b