Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
TIME CLOCK code? | Excel Discussion (Misc queries) | |||
TIME CLOCK CODE | Excel Discussion (Misc queries) | |||
How do I calculate time in excel (clock in and clock out | Excel Discussion (Misc queries) | |||
Change EXCEL Clock to Standard Clock or Military Time | Excel Worksheet Functions | |||
Calculating Total Number of Minutes in a Clock Setting | Excel Discussion (Misc queries) |