Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a workbook containing 5 imported tables that i want to refresh every hour at 20 minutes past the hour. The below code will only refresh them once at 20 minutes past. Plese can you help me adapt this code to keep refreshing tem every hour at 20 past? Option Explicit Dim dNext As Date Sub Auto_Open() dNext = TimeSerial(Hour(Now) + IIf(Minute(Now) < 20, 0, 1), 20, 0) Application.OnTime dNext, "refreshdata" Workbooks(ActiveWorkbook.Name).RefreshAll End Sub Sub refreshdata() dNext = TimeSerial(Hour(dNext) + 1, 20, 0) Application.OnTime dNext, "refreshdata" Workbooks(ActiveWorkbook.Name).RefreshAll End Sub Sub cancelTimer() Application.OnTime dNext, "refreshdata", , False End Sub Edit/Delete Message -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=553758 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need expert VBA help | Excel Discussion (Misc queries) | |||
Is anyone an expert? | Excel Discussion (Misc queries) | |||
Excel VBA expert required! Small to medium job. | Excel Programming | |||
Your expert help required pls. | Excel Programming | |||
PIE CHART EXPERT HELP REQUIRED | Charts and Charting in Excel |