Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default 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
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



All times are GMT +1. The time now is 07:54 AM.

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

About Us

"It's about Microsoft Excel"