Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd like this macro to run only on Mon and Tues. This is what I wrote:
Sub Auto_Open() If Weekday(Now()) = 2 Or 3 Then Call CreateProjStatMenubar End If End Sub But the macro runs every day. Any suggestions? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Try If Weekday(Now) = 2 Or Weekday(Now) = 3 Then ' your code here End If Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Fri, 6 Feb 2009 12:52:24 -0700, salgud wrote: I'd like this macro to run only on Mon and Tues. This is what I wrote: Sub Auto_Open() If Weekday(Now()) = 2 Or 3 Then Call CreateProjStatMenubar End If End Sub But the macro runs every day. Any suggestions? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this...
Sub Auto_Open() If Weekday(Date, vbMonday) < 3 Then Call CreateProjStatMenubar End Sub -- Rick (MVP - Excel) "salgud" wrote in message .. . I'd like this macro to run only on Mon and Tues. This is what I wrote: Sub Auto_Open() If Weekday(Now()) = 2 Or 3 Then Call CreateProjStatMenubar End If End Sub But the macro runs every day. Any suggestions? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It tests for if any of those is true:
Weekday(Now()) = 2 or 3 ! Test this: Sub Test() If 3 Then MsgBox "ok" End If End Sub ... runs every day. Switch to If Weekday(Now()) = 2 Or Weekday(Now()) = 3 Then HTH. Best wishes Harald "salgud" wrote in message .. . I'd like this macro to run only on Mon and Tues. This is what I wrote: Sub Auto_Open() If Weekday(Now()) = 2 Or 3 Then Call CreateProjStatMenubar End If End Sub But the macro runs every day. Any suggestions? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 6 Feb 2009 12:52:24 -0700, salgud wrote:
I'd like this macro to run only on Mon and Tues. This is what I wrote: Sub Auto_Open() If Weekday(Now()) = 2 Or 3 Then Call CreateProjStatMenubar End If End Sub But the macro runs every day. Any suggestions? Thanks to all! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Auto_Open()
If Weekday(Date) = 2 _ Or weekday(date) = 3 Then Call CreateProjStatMenubar End If End Sub salgud wrote: I'd like this macro to run only on Mon and Tues. This is what I wrote: Sub Auto_Open() If Weekday(Now()) = 2 Or 3 Then Call CreateProjStatMenubar End If End Sub But the macro runs every day. Any suggestions? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How To INCREMENT days of the week? like mon,tues,wed,etc?? | Excel Worksheet Functions | |||
Function for generating all Mon, Tues, etc for each month | Excel Worksheet Functions | |||
Be Sure to vote for HUSSEIN OBAMA on Tues | Excel Discussion (Misc queries) | |||
Figuring number of Mon. Tues. Wed between dates | Excel Worksheet Functions | |||
In excel how set up a sequence to drag Mon, Tues, Wed Etc, | Excel Discussion (Misc queries) |