Bill_Biggs
Well-known Member
- Joined
- Feb 6, 2007
- Messages
- 1,216
I have created a macro that continually updates a pivot chart. The macro runs constanly, not unlike a permanent loop.
I need the macro stop approximately every minute and update. Here is the command for that:
<font face=Courier New>B = Now</FONT>
Established earlier in the macro
<font face=Courier New><SPAN style="color:#00007F">If</SPAN> B <= B + TimeValue("00:01:03") And B >= B - TimeValue("00:00:57") <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">GoTo</SPAN> Alpha<br></FONT>
The problem is that when the command loops the the line above, if the time is not precisely either of the times listed, it ignores the command and keeps going. Is there a way I can have the macro goto Alpha if the time is BETWEEN the two times listed?
I need the macro stop approximately every minute and update. Here is the command for that:
<font face=Courier New>B = Now</FONT>
Established earlier in the macro
<font face=Courier New><SPAN style="color:#00007F">If</SPAN> B <= B + TimeValue("00:01:03") And B >= B - TimeValue("00:00:57") <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">GoTo</SPAN> Alpha<br></FONT>
The problem is that when the command loops the the line above, if the time is not precisely either of the times listed, it ignores the command and keeps going. Is there a way I can have the macro goto Alpha if the time is BETWEEN the two times listed?
Last edited: