I've been using a workbook that contains the following code:
Sub New_Pivot_refresh()
'
' New_Pivot_refresh Macro
'
'
Sheets("1. COGS vs. Production").Select
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("E17").Select
ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
Range("H14").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
Range("U24").Select
ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh
Range("W22").Select
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
Sheets("Panel").Select
Range("A1").Select
End Sub
As you can see, there are few comments explaining how it all works. Can anyone explain a couple of things to me?
Sub New_Pivot_refresh()
'
' New_Pivot_refresh Macro
'
'
Sheets("1. COGS vs. Production").Select
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("E17").Select
ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
Range("H14").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
Range("U24").Select
ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh
Range("W22").Select
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
Sheets("Panel").Select
Range("A1").Select
End Sub
As you can see, there are few comments explaining how it all works. Can anyone explain a couple of things to me?
- Activewindow.Scrollcolumn - what is this doing and why are there four different values provided one after another?
- Is there a significance to each of the cell references? (E17, H14, U24, W22, A1)