Option Explicit
Sub Test()
Dim dtmStart As Date
Dim dtmEnd As Date
dtmStart = ThisWorkbook.Worksheets("Auswertung").Range("B5").Value
dtmEnd = ThisWorkbook.Worksheets("Auswertung").Range("B6").Value
Dim strCriteria1 As String
Dim strCriteria2 As String
strCriteria1 = ">=" & Format$(dtmStart, "yyyy-mm-dd")
strCriteria2 = "<=" & Format$(dtmEnd, "yyyy-mm-dd")
Dim rng As Excel.Range
Set rng = ThisWorkbook.Worksheets("Daten").Range("A1:J2000")
Call rng.AutoFilter(2, strCriteria1, xlAnd, strCriteria2)
End Sub
|