Thanks for all the help & tips I've got from this forum so far.
I'm trying to develop this code to ask the
user to input the Start Date & End Date of a report (I've got 2 Input Boxes).
With the inputed responses, I
would like to run an Auto Filter with these dates as the criterion.
Here's what I've got so far, but it doesn't
work.....It's not filtering anything apart from the first record, and that's probably only because it's there !!!!!
I've used dates that I know there are records for but they don't get filtered.
To build this macro I started with
the Input Boxes, got them going & then started a seperate macro to do the Auto Filter (with selecting dates from the
lists in the criteria box), then let it do that filter, then copied the main part of that macro onto the end of the first
macro & changed the original dates to the Input Box names.
Maybe that's where I'm going wrong ?????
Column F is formatted as Date, dd-mm-yyyy
StartDate = InputBox("Please enter START date of Report - DD-MM-YYYY")
EndDate = InputBox("Please enter END date of Report - DD-MM-YYYY")
Selection.AutoFilter Field:=1, Criteria1:=">=StartDate", Operator:=xlAnd _
Range("BC2").Select (I'd like this to be the Start Date)
Range("BC3").Select (End Date)
I haven't got any validation checks in the macro as you can see, because I'm not sure of the syntax of Date ones so if anyone
can help me with that as well, that would be much appreciated. FWI, the dates can be back to Jan-2008 and as new as last
On that part I would like to paste the dates from the Input Boxes to the 2 cells at the end of my macro.
I have looked on here to see how to paste Input Box responses but couldn't find anything as simple.
As the next
part of this process, I'll be copying the filtered records to Sheet 3 so again, any help with that would be appreciated.
I should be able to at least start the macro, but where I would need help is telling the macro to stop when it comes to the
last filtered record.
Thanks again for all the help.