Need help with code

  • Thread starter Thread starter alexm999
  • Start date Start date
A

alexm999

I have a macro that a user will run every day to gather information fro
another spreadsheet.

Right now the user has to delete the previous days info and run th
macro.
Is there a way I can have the macro test to see if the day of the wee
has changed, then to delete cells D3,D4,D5 & D6 and run the macro?

Also, i'd like to use the =now() function in the macro for cell A7 tha
when the macro runs, it tell the operator (sometimes a different person
when the program ran last?

thank
 
if the day of the week has changed from what? Are we comparing the day of
the week for today against the day of the week recorded where?

=Now will recalculate every time the sheet calculates - so it will change
every day (it isn't static). .

You can have your macro just put in the date as part of the work that it
does.

Worksheets("Sheet3").Range("A7").Value = Date
 
If the macro is run on Monday it will populate the cells, when the macro
is rerun on tuesday, i need Monday numbers to be deleted prior to the
macro running cause it can through the formula off..
 
I thought that was the whole point of the question, to have the macro clear
the cells. If I run it on monday and check it on tuesday, the cells will be
populated. If I run it on Tuesday and check it on Wednesday, the cells will
be populated from Tuesday's run. Where is the difference? As I said what
do you want to check against.

If all you want to check against is that the cells are populated, why
bother, just clear them. If they are populated or not the results are the
same.

Range(D3:D6").Clearcontents
 

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

Back
Top