Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Sub udfTimeDelay()
'  Use the OnTime method to set an amount of time to pause before running additional macro commands. The OnTime method uses
'  the following syntax:
'
'      expression.OnTime(When, Name, Tolerance)
'
'  Because the Name argument requires the name of a macro to run, you must create two macros. The first macro contains the
'  OnTime method call and other commands relevant to your macro. The second macro runs when the allotted time has passed. The
'  second macro can be a "dummy" macro that does nothing.
'
'  This example runs the macro named "MyDelayMacro" for 15 seconds from the time the example macro (MyMainMacro) is run.
        ' Pause for 15 seconds.
    Application.OnTime When:=Now + TimeValue("00:00:15"), Name:="MyDelayMacro"
''' Sub MyDelayMacro()
'''' Place your delayed macro commands here.
'''    MsgBox "This macro runs after 15 seconds."
'''End Sub
End Sub

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Sub udfTimeDelay()
'  Use the OnTime method to set an amount of time to pause before running additional macro commands. The OnTime method uses
'  the following syntax:
'
'      expression.OnTime(When, Name, Tolerance)
'
'  Because the Name argument requires the name of a macro to run, you must create two macros. The first macro contains the
'  OnTime method call and other commands relevant to your macro. The second macro runs when the allotted time has passed. The
'  second macro can be a "dummy" macro that does nothing.
'
'  This example runs the macro named "MyDelayMacro" for 15 seconds from the time the example macro (MyMainMacro) is run.
        ' Pause for 15 seconds.
    Application.OnTime When:=Now + TimeValue("00:00:15"), Name:="MyDelayMacro"
''' Sub MyDelayMacro()
'''' Place your delayed macro commands here.
'''    MsgBox "This macro runs after 15 seconds."
'''End Sub
End Sub

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1