Timing trigger

D

Dave Hawks

Can anyone suggest suitable code to insert into an existing piece of code,
which will allow it to run only between certain hours each day.
Thanks
 
M

Marshall Barton

Dave said:
Can anyone suggest suitable code to insert into an existing piece of code,
which will allow it to run only between certain hours each day.


How about putting the code in an If block:

If TimeValue(Now) > #7:00# And TimeValue(Now) < #17:00# Then
' your code here
Else
MsgBox "not now"
End If
 
D

Dave Hawks

That worked
Thanks
--
Dave Hawks


Marshall Barton said:
How about putting the code in an If block:

If TimeValue(Now) > #7:00# And TimeValue(Now) < #17:00# Then
' your code here
Else
MsgBox "not now"
End If
 
Top