hello
i have 2 date values in excel spreadsheet ( i must use it by the sheet) and i want to flter table by the date coulmn and AutoFilter, when the start date and the end date will be taken from the sheet itself.
but when i defined date varible like starta and edit the filter (Criteria1:=">=starta") it didt work (the value was starta and not the date in the starta)
how to edit it?
thanks
sub abcd
Dim starta As Date, enda As Date
starta = Worksheets("periods and options").Range("a1").Value
enda = Worksheets("periods and options").Range("b1").Value
Sheets("DATAF").Range("a11325").Select
Selection.AutoFilter Field:=1, Criteria1:=">=starta", Operator:=xlAnd _
, Criteria2:="<=enda"
End Sub
i have 2 date values in excel spreadsheet ( i must use it by the sheet) and i want to flter table by the date coulmn and AutoFilter, when the start date and the end date will be taken from the sheet itself.
but when i defined date varible like starta and edit the filter (Criteria1:=">=starta") it didt work (the value was starta and not the date in the starta)
how to edit it?
thanks
sub abcd
Dim starta As Date, enda As Date
starta = Worksheets("periods and options").Range("a1").Value
enda = Worksheets("periods and options").Range("b1").Value
Sheets("DATAF").Range("a11325").Select
Selection.AutoFilter Field:=1, Criteria1:=">=starta", Operator:=xlAnd _
, Criteria2:="<=enda"
End Sub