How to records that the date field = todays date in VBA

V

Villagio

DATE CODE DESCRIPTION OLD
NEW UOM
------------- ------- ----------------------------------------
----- ------ ------
3/26/2010 *1438 ETHYL-2-METHYL BUTYRATE(E) 8.14 9.15 KG
4/6/2010 *0068 BENZYL BENZOATE(E)(I43) 5.00 6.00 KG

How do I program in VBA to set the print area that the date field is today's
date? Thanks.

PC
 
J

Jim Thomlinson

Did you only want todays date or did you want everything up to todays date?
What if there is more than one instance of todays date? What if they are not
contiguious?
 
F

Fred Smith

You probably want to use Data Filter. The VBA function for today's date is
DATE. You will probably need to format it based on the formatting in your
column. What I do to find the correct code is:
-- turn on macro recording.
-- turn on Data Filter
-- filter the column, pick today's date
-- turn off macro recording.

Now I copy this code into my program, and edit it to use the DATE function.

Regards,
Fred
 

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