i have the following macro setup for my refresh button, the problem is that it does not seem to work every time to refresh the results page which contains my summary data and my pivot tables.
Anyone see anything blatantly wrong?
The Macro i have setup is as follows:
Sub Macro1()
'
' Macro1 Macro
'
On Error Resume Next
Response = Application.InputBox("Please enter in the Start Date as: MM/DD/YYYY", "Start Date", Range("A1").Value, 50, 150, "", , 1)
If Response <> False Then
ActiveSheet.Range("A1").Value = Response
Else
MsgBox ("Exiting Input! No Calculation will take place")
Exit Sub
End If
Response = Application.InputBox("Please enter in the End Date as: MM/DD/YYYY", "End Date", Range("A2").Value, 50, 150, "", , 1)
If Response <> False Then
ActiveSheet.Range("A2").Value = Response
Else
MsgBox ("Exiting Input! No Calculation will take place")
Exit Sub
End If
'
ActiveWorkbook.RefreshAll
Calculate
'
Sheets("Result Page").Select
ActiveSheet.PivotTables("PivotTable-1").RefreshTable
ActiveSheet.PivotTables("PivotTable-2").RefreshTable
ActiveSheet.PivotTables("PivotTable-3").RefreshTable
ActiveSheet.PivotTables("PivotTable-4").RefreshTable
ActiveSheet.PivotTables("PivotTable-5").RefreshTable
ActiveSheet.PivotTables("PivotTable-6").RefreshTable
ActiveSheet.PivotTables("PivotTable-1-W").RefreshTable
ActiveSheet.PivotTables("PivotTable-1-S").RefreshTable
ActiveSheet.PivotTables("PivotTable-2-W").RefreshTable
ActiveSheet.PivotTables("PivotTable-2-S").RefreshTable
' ActiveSheet.PivotTables("PivotTable-3-W").RefreshTable
' ActiveSheet.PivotTables("PivotTable-4-W").RefreshTable
ActiveSheet.PivotTables("PivotTable-5-W").RefreshTable
ActiveSheet.PivotTables("PivotTable-6-W").RefreshTable
ActiveSheet.PivotTables("PivotTable-6-S").RefreshTable
Sheets("Result Page").F9
Sheets("Result Page").Refresh
End Sub