LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Expert Required


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need expert VBA help robert morris Excel Discussion (Misc queries) 1 February 23rd 09 02:22 PM
Is anyone an expert? Schwimms Excel Discussion (Misc queries) 15 June 4th 07 06:35 PM
Excel VBA expert required! Small to medium job. Sonny[_3_] Excel Programming 0 August 22nd 05 11:51 PM
Your expert help required pls. bob Excel Programming 1 July 17th 05 04:53 PM
PIE CHART EXPERT HELP REQUIRED Co-op Bank Charts and Charting in Excel 2 March 30th 05 02:21 PM


All times are GMT +1. The time now is 04:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"