Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I set this up
I want to setup a macro, in a file, that only run once on a specific day of
the week regardless of who first open the file. The macro needs to run only once, every monday, the first time the file is open. Any subsequent opening of the file after that, the macro should not run. How do I go about setting this up? I just need someone to point me in a generally direction and I should be able to take it from there. Thanks Ayo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I set this up
Hi,
You could do this which checks if it's a Monday and if the Mondays date isn't in sheet 1 A1 amd then calls tour macro. It prevents a second run by writing the date to a1 Private Sub Workbook_Open() If Weekday(Date) = 1 And Sheets("Sheet1").Range("A1").Value < Date Then Sheets("Sheet1").Range("A1").Value = Date Call MyMacro End If End Sub Mike "Ayo" wrote: I want to setup a macro, in a file, that only run once on a specific day of the week regardless of who first open the file. The macro needs to run only once, every monday, the first time the file is open. Any subsequent opening of the file after that, the macro should not run. How do I go about setting this up? I just need someone to point me in a generally direction and I should be able to take it from there. Thanks Ayo |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I set this up
OK. In the thisworkbook module put in a workbook_open macro to run the macro
and put todays date somewhere. Have the macro check to see if the date is later or not run. -- Don Guillett Microsoft MVP Excel SalesAid Software "Ayo" wrote in message ... I want to setup a macro, in a file, that only run once on a specific day of the week regardless of who first open the file. The macro needs to run only once, every monday, the first time the file is open. Any subsequent opening of the file after that, the macro should not run. How do I go about setting this up? I just need someone to point me in a generally direction and I should be able to take it from there. Thanks Ayo |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I set this up
OK. In the thisworkbook module put in a workbook_open macro to run the macro
and put todays date somewhere. Have the macro check to see if the date is later or not run. -- Don Guillett Microsoft MVP Excel SalesAid Software "Ayo" wrote in message ... I want to setup a macro, in a file, that only run once on a specific day of the week regardless of who first open the file. The macro needs to run only once, every monday, the first time the file is open. Any subsequent opening of the file after that, the macro should not run. How do I go about setting this up? I just need someone to point me in a generally direction and I should be able to take it from there. Thanks Ayo |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I set this up
Thanks Mike.
I will try this. Should Work fine. "Mike H" wrote: Hi, You could do this which checks if it's a Monday and if the Mondays date isn't in sheet 1 A1 amd then calls tour macro. It prevents a second run by writing the date to a1 Private Sub Workbook_Open() If Weekday(Date) = 1 And Sheets("Sheet1").Range("A1").Value < Date Then Sheets("Sheet1").Range("A1").Value = Date Call MyMacro End If End Sub Mike "Ayo" wrote: I want to setup a macro, in a file, that only run once on a specific day of the week regardless of who first open the file. The macro needs to run only once, every monday, the first time the file is open. Any subsequent opening of the file after that, the macro should not run. How do I go about setting this up? I just need someone to point me in a generally direction and I should be able to take it from there. Thanks Ayo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|