Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help with code

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help with code

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

--
Regards,
Tom Ogilvy


"alexm999 " wrote in message
...
I have a macro that a user will run every day to gather information from
another spreadsheet.

Right now the user has to delete the previous days info and run the
macro.
Is there a way I can have the macro test to see if the day of the week
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 that
when the macro runs, it tell the operator (sometimes a different person)
when the program ran last?

thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help with code

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..


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help with code

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



--
Regards,
Tom Ogilvy


"alexm999 " wrote in message
...
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..


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Code to conditional format all black after date specified in code? wx4usa Excel Discussion (Misc queries) 3 December 26th 08 07:06 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM
VBA code delete code but ask for password and unlock VBA protection WashoeJeff Excel Programming 0 January 27th 04 07:07 AM


All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"