Macro - Variable Dates

chris778

New Member
Joined
Jul 11, 2007
Messages
7
Hi All,

I need some help with a macro I am trying to develop. The basic idea is that I get my raw data file, and the macro runs across it removing all of the information which I don't need. The data I am using is produced in a format which repeats the date and headings on every page - once this is exported into Excel I therefore get multiple occurances of the date / headings. I had been using autofilters in the macro to sort / select and delete the relevant rows, but of course when it comes to dates this will change every day so the macro can't pick up these occurances. Is there a commend I can put into my macro which will look for occurances of today's date?

Thanks,


Chris
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
this will assign x as today's date
Code:
x = Format(Now() - 1, "mm-dd-yyyy")

HTH
 

Forum statistics

Threads
1,181,102
Messages
5,928,062
Members
436,586
Latest member
latintxn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top