Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code is not working, does anyone have any suggestions on how to
fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Eric
If Weekday(Today) = 1 Or Weekday(Today) = 7 Or Hour(Now) 16 Then Mike "Eric" wrote: The following code is not working, does anyone have any suggestions on how to fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Eric
Mike meant to say; If Weekday(Date)=1 OR Weekday(Date)=7 OR Hour(Now) 16 Then 'if any of the above conditions apply End If OR you can try If Left(Format(Date,"ddd"),1) = "S" OR Hour(Now) 16 Then 'if any of the above conditions apply End If If this post helps click Yes --------------- Jacob Skaria "Eric" wrote: The following code is not working, does anyone have any suggestions on how to fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jacob,
Yes i did mean to say that, I corrected the syntax without checkuing the code properly. Thanks. Mike "Jacob Skaria" wrote: Hi Eric Mike meant to say; If Weekday(Date)=1 OR Weekday(Date)=7 OR Hour(Now) 16 Then 'if any of the above conditions apply End If OR you can try If Left(Format(Date,"ddd"),1) = "S" OR Hour(Now) 16 Then 'if any of the above conditions apply End If If this post helps click Yes --------------- Jacob Skaria "Eric" wrote: The following code is not working, does anyone have any suggestions on how to fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Welcome..It happens with me too.. (more now a days)
"Mike H" wrote: Jacob, Yes i did mean to say that, I corrected the syntax without checkuing the code properly. Thanks. Mike "Jacob Skaria" wrote: Hi Eric Mike meant to say; If Weekday(Date)=1 OR Weekday(Date)=7 OR Hour(Now) 16 Then 'if any of the above conditions apply End If OR you can try If Left(Format(Date,"ddd"),1) = "S" OR Hour(Now) 16 Then 'if any of the above conditions apply End If If this post helps click Yes --------------- Jacob Skaria "Eric" wrote: The following code is not working, does anyone have any suggestions on how to fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then
Hi. Just another option: 'Weekend is 6 or 7 If Weekday(Now, 2) = 6 Or Hour(Now) 16 Then = = = = = Dana DeLouis Jacob Skaria wrote: Welcome..It happens with me too.. (more now a days) "Mike H" wrote: Jacob, Yes i did mean to say that, I corrected the syntax without checkuing the code properly. Thanks. Mike "Jacob Skaria" wrote: Hi Eric Mike meant to say; If Weekday(Date)=1 OR Weekday(Date)=7 OR Hour(Now) 16 Then 'if any of the above conditions apply End If OR you can try If Left(Format(Date,"ddd"),1) = "S" OR Hour(Now) 16 Then 'if any of the above conditions apply End If If this post helps click Yes --------------- Jacob Skaria "Eric" wrote: The following code is not working, does anyone have any suggestions on how to fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Whatever code you use, you may want to replace the numbers that represent the
day of the week with their VBA constants (vbSunday, ..., vbSaturday). VBA's help shows the list and the values they represent. It'll make the code a little easier to read in a week or so... Eric wrote: The following code is not working, does anyone have any suggestions on how to fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric -- Dave Peterson |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have tried Now for weekday, which is working too.
Thank everyone very much for suggestions Eric "Jacob Skaria" wrote: Hi Eric Mike meant to say; If Weekday(Date)=1 OR Weekday(Date)=7 OR Hour(Now) 16 Then 'if any of the above conditions apply End If OR you can try If Left(Format(Date,"ddd"),1) = "S" OR Hour(Now) 16 Then 'if any of the above conditions apply End If If this post helps click Yes --------------- Jacob Skaria "Eric" wrote: The following code is not working, does anyone have any suggestions on how to fix the code for macro? If or(weekday(Today)=1,weekday(Today)=7,Hour(Now) 16) Then Thanks in advance for any suggestions Eric |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro code to dll and vba code trouble shoot. | Excel Programming | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming | |||
Can I use code/macro to change code/macro in an existing file? | Excel Programming | |||
read macro code by vb code | Excel Programming | |||
do anybody have a sample code for executing excel macro from vb code?<eom | Excel Programming |