Autofilter

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
 
R

Ron de Bruin

Hi Grid

Try this for column A

Columns("A").AutoFilter Field:=1, Criteria1:=">=" & DateSerial(Year(Date), Month(Date), Day(Date))
 
G

Guest

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
 
G

Guest

Ignore previous please Ron, put CLng in and it works fine. Thanks for your
patience.
Grid
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top