Hi All,
I create below macro, Macro runing. but I cna't get result
Sub MyAutofilter()
Dim st As Long, en As Long
st = Range("s1").Value '''''''''assume this is the start date
en = Range("t1").Value ''''''assume this is the end date
Range("A1:I1").AutoFilter
ActiveSheet.Range("G2:G1500").AutoFilter Field:=7, Criteria1:= _
">=& st", Operator:=xlAnd, Criteria2:="<=& en"
End Sub
I create below macro, Macro runing. but I cna't get result
Sub MyAutofilter()
Dim st As Long, en As Long
st = Range("s1").Value '''''''''assume this is the start date
en = Range("t1").Value ''''''assume this is the end date
Range("A1:I1").AutoFilter
ActiveSheet.Range("G2:G1500").AutoFilter Field:=7, Criteria1:= _
">=& st", Operator:=xlAnd, Criteria2:="<=& en"
End Sub
Last edited: