![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi everyone!
I would appreciate it very much if someone could share some code which will start a two minute cycle when a workbook is opened. This workbook will check a data source as soon as it is opened. I would like to make it able to repeat this task every two minutes. Thanks! [ This Message was edited by: TsTom on 2002-03-24 11:22 ] |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
Hi TS Tom - how's this?
Code:
Dim lngTimesMacroRan As Long
Sub CheckDataSource()
'Put your macro for checking the data source in here
'E.g.
Sheets("Sheet1").Cells(1, 1).Value = "The macro CheckDataSource has ran " & lngTimesMacroRan + 1 & " times."
lngTimesMacroRan = lngTimesMacroRan + 1
Application.OnTime Now + TimeValue("00:02:00"), "CheckDataSource"
End Sub
D |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Thanks DK
I will try it out. Tom |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|