Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am currently running Ontime to run a macro every hour. The project that I
am running this for opens at 8a and closes at 9p. Is there a way to insert a If/Then statement that would state...If the time is between 8 and 21:00 then run update_line_currentday, else end sub.??? I would like to palce this code inside the macro that Ontime is trying to run so that Ontime will remain running in the off time. Thanks for any help in advance! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() EW try If TimeValue(Now()) < TimeValue("08:00") _ Or TimeValue(Now()) TimeValue("21:00") Then Exit Sub End If or Select Case Hour(Now()) Case Not 8 To 21 Exit Sub Case Else Stop End Selec -- mudrake ----------------------------------------------------------------------- mudraker's Profile: http://www.excelforum.com/member.php...nfo&userid=247 View this thread: http://www.excelforum.com/showthread.php?threadid=53249 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The first if/then statement worked brilliantly!
"mudraker" wrote: EW try If TimeValue(Now()) < TimeValue("08:00") _ Or TimeValue(Now()) TimeValue("21:00") Then Exit Sub End If or Select Case Hour(Now()) Case Not 8 To 21 Exit Sub Case Else Stop End Select -- mudraker ------------------------------------------------------------------------ mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473 View this thread: http://www.excelforum.com/showthread...hreadid=532494 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find %ontime & SUMIF ontime ie: find matching sets within Range... | Excel Worksheet Functions | |||
Starting and Stopping excel from command line. | Excel Discussion (Misc queries) | |||
Starting/Stopping Worksheet Event Code | Excel Discussion (Misc queries) | |||
OnTime Help | Excel Programming | |||
Starting a userform upon starting the file | Excel Programming |