Autofilter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using "CLng(Range("V1").Value)" in VBA I end up with 19/11/06 in the custom
box, when the actual date is 26/11. Field formatted dd/mm/yyyy. Just want to
autofilter on "Today" using a macro/VBA code. All ideas appreciated.
Grid
 
Hi Grid

Try this for column A

Columns("A").AutoFilter Field:=1, Criteria1:=">=" & DateSerial(Year(Date), Month(Date), Day(Date))
 
Thanks Ron, it works great, but is there a way to continue the macro without
having to open the Custom autofilter box and click OK?
Grid
 
No Ron, runs all the way through perfectly. I just put CLng in to give:
Columns("h").AutoFilter Field:=8, Criteria1:="<" &
CLng(DateSerial(Year(Date), Month(Date), Day(Date)))
Thanks again Ron. Hopefully the above will help someone else out.
Grid
 
Back
Top