Refresh data with macro code

Joined
Jul 20, 2012
Messages
1
Reaction score
0
Hey guys,

I'm working on the macro code to refresh my 2 worksheets at a specific time. However because the other worksheet contains many data, therefore it needs at least 3 minutes to refresh and then refresh the pivot table. Anybody knows how to set up a code for that. This is so far how I set up the code.

Public Const cRunWhat = "RefreshData"
Sub StartTimer()

Application.OnTime ("09:08:00"), Procedure:=cRunWhat, _
Schedule:=True
End Sub

Sub RefreshData()
'
' Macro1 Macro
'
'
Sheets("detail_inventory_data").Select
Selection.ListObject.QueryTable.refresh BackgroundQuery:=True
Sheets("Dashboard").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.refresh
StartTimer
End Sub
 
Back
Top