Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a macro that I run Monday, Tuesday, Wednesday & Friday. Then I have a second Macro that I run after I run the one mentioned above. My question can I paste in the second macro in with the first but only have it run on Thursdays?? Any help is greatly appreaciated, Lime |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if weekday(date,2) 5 then exit sub
if weekday(date,2) = 4 then ' Thursday ' code for macro 2 else ' code for macro 1 end if -- Regards, Tom Ogilvy "Lime" wrote: Hello, I have a macro that I run Monday, Tuesday, Wednesday & Friday. Then I have a second Macro that I run after I run the one mentioned above. My question can I paste in the second macro in with the first but only have it run on Thursdays?? Any help is greatly appreaciated, Lime |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use the Now Function to get the current date and time from your
computer. Then use an if statement to determine if weekday is thursday. Something like: If weekday(Now) = 5 Then macro2 End If Don't paste the macro into the first one just set it to run at the end of your if statement. Just make sure both macros are in the same module or workbook. "Lime" wrote: Hello, I have a macro that I run Monday, Tuesday, Wednesday & Friday. Then I have a second Macro that I run after I run the one mentioned above. My question can I paste in the second macro in with the first but only have it run on Thursdays?? Any help is greatly appreaciated, Lime |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running the second part of a macro only on Thursdays? | Excel Programming | |||
Thursdays dates between 04/16/06 - 05/15/06 | Excel Worksheet Functions | |||
Is there a function to return all Thursdays in a given month/yr | Excel Worksheet Functions | |||
Jump Thursdays in a month | Excel Discussion (Misc queries) | |||
Is it possible to grab just the Mondays-Thursdays of every month? | Excel Discussion (Misc queries) |