Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default Starting and stopping Ontime

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Starting and stopping Ontime


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   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default Starting and stopping Ontime

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
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find %ontime & SUMIF ontime ie: find matching sets within Range... Chris T-M Excel Worksheet Functions 3 October 10th 08 08:14 PM
Starting and Stopping excel from command line. Bruce Edwards Excel Discussion (Misc queries) 1 April 27th 08 06:34 PM
Starting/Stopping Worksheet Event Code Paul987 Excel Discussion (Misc queries) 1 March 20th 06 04:43 PM
OnTime Help Mark Scholes Excel Programming 1 January 30th 04 03:48 AM
Starting a userform upon starting the file Fritznel Excel Programming 1 July 28th 03 05:37 AM


All times are GMT +1. The time now is 08:38 AM.

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

About Us

"It's about Microsoft Excel"