habe folgendes Makro für das aufrufen der UF.
Leider klappt es nicht, wenn ich die Filterung durchführe, Wieso ?
Wenn ich nur sortiere wird alles eingelesen.
Habe die Tabelle eingesehen die Filterung sieht man dort, nur
halt wird die UF nicht neu angezeigt.
mfg Kurt P
Application.ScreenUpdating = False
Sheets("ALLE ").Select
Range("X22").Select
Range("A1:G1").Select
If ActiveSheet.AutoFilterMode Then
Selection.AutoFilter
End If
Dim z As Long
Range("A2").Select
z = Range("A2").End(xlDown).Row
ActiveSheet.Range(Cells(2, 1), Cells(z, 7)).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
x = IIf(IsEmpty(Range("A65536")), Range("A65536").End(xlUp).Row, 65536)
UFVKNamenSuchen.ListBox1.RowSource = "A2:A" & x
x = IIf(IsEmpty(Range("B65536")), Range("B65536").End(xlUp).Row, 65536)
UFVKNamenSuchen.ListBox2.RowSource = "B2:B" & x
x = IIf(IsEmpty(Range("G65536")), Range("G65536").End(xlUp).Row, 65536) UFVKNamenSuchen.ListBox3.RowSource = "G2:G" & x
x = IIf(IsEmpty(Range("C65536")), Range("C65536").End(xlUp).Row, 65536) UFVKNamenSuchen.ListBox4.RowSource = "C2:C" & x
x = IIf(IsEmpty(Range("E65536")), Range("E65536").End(xlUp).Row, 65536) UFVKNamenSuchen.ListBox5.RowSource = "E2:E" & x
'x = IIf(IsEmpty(Range("P65536")), Range("P65536").End(xlUp).Row, 65536)
' UFVKNamenSuchen.ListBox5.RowSource = "P2:P" & x
'x = IIf(IsEmpty(Range("Q65536")), Range("Q65536").End(xlUp).Row, 65536)
' UFVKNamenSuchen.ListBox6.RowSource = "Q2:Q" & x
'x = IIf(IsEmpty(Range("R65536")), Range("R65536").End(xlUp).Row, 65536)
' UFVKNamenSuchen.ListBox7.RowSource = "R2:R" & x
TextBox1.SetFocus
With TextBox1
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
Application.ScreenUpdating = True
End Sub
Dim ws As Worksheet
For Each ws In Worksheets
' ws.Protect userinterfaceonly:=True, Password:="kk"
ws.EnableAutoFilter = True 'ermöglicht Autofilter
' ws.EnableOutlining = True 'ermöglicht Gruppierung/Gliederung
Next ws
'-------------------------------------------
Range("A1:G1").Select
If Not ActiveSheet.AutoFilterMode Then
Selection.AutoFilter
End If
Range("G2").Select
Selection.AutoFilter Field:=3, Criteria1:="00"
Dim z As Long
Range("A2").Select
z = Range("A2").End(xlDown).Row
ActiveSheet.Range(Cells(2, 1), Cells(z, 7)).Select
'--- sortieren Aufsteigend -----------------
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Range("A2").Select
End Sub