LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Run an Excel code every 15 minutes of the clock

Peter,


Thumbs up to you.


Thomas


"Peter T" wrote:

Indeed the Now function is "Invalid Outside Procedure", you need to put it
inside a procedure. Eg

Sub abc()
dim dt as Date
dt = Now
Msgbox dt
End sub

For your future reference, The top of a module is the "Declarations" area.
This is where API functions are declared, together with module or global
level variables and constants. Everything else belongs in a procedure (Sub,
Function, etc).

It's normally best to store the time the Onime macro scheduled to run in a
module level variable is so it can be cancelled if/as necessary, which you
can do by calling the OnTime as normal but with the argument Schedule:=False

It's not clear when you do / don't want to run the OnTime, gaps (not
lunchtime?) the first time and when to cancel it altogether. Try and
describe.

Regards,
Peter T


 
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
TIME CLOCK code? Jase Excel Discussion (Misc queries) 4 April 30th 08 10:00 PM
TIME CLOCK CODE Jase Excel Discussion (Misc queries) 0 April 29th 08 06:46 PM
How do I calculate time in excel (clock in and clock out chad Excel Discussion (Misc queries) 3 January 7th 08 10:09 PM
Change EXCEL Clock to Standard Clock or Military Time YoMarie Excel Worksheet Functions 4 April 29th 07 08:39 PM
Calculating Total Number of Minutes in a Clock Setting Larry H Excel Discussion (Misc queries) 3 October 7th 05 11:25 PM


All times are GMT +1. The time now is 05:18 PM.

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"