T
Tim
Hi,
I have a small piece of VBA which is used to filter a list (using a custom
autofilter) between 2 sets of dates from input boxes (code below). my
problem is that it doesn't filter the list properly (hides all the data). i
think its because the criteria (rng1 & rng2) in the autofilter should be in
quotes, but i don't know how to do that... i can't work out how to make
another variable which is a concatenation of " & rng1 & "
could someone please help me (or tell me an easier way to aceive the same
thing!)?
Thanks,
Tim
======
Sub ChooseDates()
Dim rng1 As Date, rng2 As Date
rng1 = InputBox("from")
rng2 = InputBox("to")
Selection.AutoFilter Field:=3, Criteria1:=rng1, Operator:=xlAnd,
Criteria2:=rng2
End Sub
I have a small piece of VBA which is used to filter a list (using a custom
autofilter) between 2 sets of dates from input boxes (code below). my
problem is that it doesn't filter the list properly (hides all the data). i
think its because the criteria (rng1 & rng2) in the autofilter should be in
quotes, but i don't know how to do that... i can't work out how to make
another variable which is a concatenation of " & rng1 & "
could someone please help me (or tell me an easier way to aceive the same
thing!)?
Thanks,
Tim
======
Sub ChooseDates()
Dim rng1 As Date, rng2 As Date
rng1 = InputBox("from")
rng2 = InputBox("to")
Selection.AutoFilter Field:=3, Criteria1:=rng1, Operator:=xlAnd,
Criteria2:=rng2
End Sub