» Execute Command/Sub-Procedure Using Timer in VBA
CATEGORY - Date & Time in VBA
VERSION - All Microsoft Excel Versions
TimeValue Function is used.
In this example, 3-seconds is assigned to the function.
The Application.OnTime alertTime statement is used to call up the sub procedure, msg, when 3-seconds is up.
Sub timerMsg()
Dim alertTime
MsgBox "The alarm will go off in 3 seconds!"
alertTime = Now + TimeValue("00:00:03")
Application.OnTime alertTime, "msg"
End Sub
Sub msg()
MsgBox "Three Seconds is up!"
End Sub
Book Store:
Recommended Books:
- Microsoft Excel Version 2002 Step by Step
- Rich Dad, Poor Dad: What the Rich Teach Their Kids About Money--That the Poor and Middle Class Do Not!
- Real Estate Finance and Investments (Real Estate Finance and Investments, 11th Ed)
- The Complete Book of Business Plans: Simple Steps to Writing a Powerful Business Plan (Small Business Sourcebooks)
- The New Financial Order: Risk in the Twenty-First Century
- 422 Tax Deductions for Businesses and Self-Employed Individuals : You Get a Raise Every Time You Find a Legitimate Tax Deduction
Execute Command/Sub-Procedure Using Timer in VBA
rdwray@isp.com
Took you code and pasted into excel after trying my own and cannot get either one to work in 2002.


the .OnTime is highlighted and a message comes up saying:
Method or data member not found