AW: Autofilter
09.08.2013 15:23:57
Rudi
Hallo,
als Ansatz
Private Sub ComboBox1_Change()
Dim objList As Object, arr, i As Long, j As Integer, arrTmp(1 To 1, 1 To 6), arrList()
Set objList = CreateObject("Scripting.Dictionary")
With Sheets(1)
arr = .Cells(1, 1).CurrentRegion
End With
For i = 2 To UBound(arr)
If MonthName(Month(arr(i, 1))) = ComboBox1 Then
For j = 1 To 6
arrTmp(1, j) = arr(i, j)
Next
objList(i) = arrTmp
End If
Next
If objList.Count = 0 Then
ListBox1.Clear
Exit Sub
End If
arr = objList.items
arr = WorksheetFunction.Transpose(arr)
arr = WorksheetFunction.Transpose(arr)
ReDim arrList(1 To objList.Count, 1 To 6)
If objList.Count > 1 Then
For i = 1 To UBound(arr)
For j = 1 To 6
arrList(i, j) = arr(i, j)
Next
Next
Else
For i = 1 To 6
arrList(1, i) = arr(i)
Next
End If
ListBox1.ColumnCount = 6
ListBox1.List = arrList
End Sub
Private Sub UserForm_Activate()
Dim i As Integer
ComboBox1.Clear
For i = 1 To 12
ComboBox1.AddItem MonthName(i)
Next
End Sub
Gruß
Rudi