koreyjames
New Member
- Joined
- Jul 23, 2012
- Messages
- 44
Hi All,
I currently have this beast of a code running in Excel 2013:
However the issue lies in that once the data is refreshed, the slicers reading off the above raw data/pivots, automatically select all weeks, however this is not beneficial for the data being presented.
Is there anyway to have, once the Pivots have been updated, for the macro to then check and select current week range (beginning Monday) only?
I currently have this beast of a code running in Excel 2013:
HTML:
Sub OBTAIN_RAW_DATA_MACRO()
Dim NextCol As Long
'Copy data
Workbooks.Open Filename:= _
"\\elan\Cognos_Export\cognos\BDC_Reporting\Central Reporting Hub Raw Data-en-au.xlsx"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.Copy
Windows("Central Reporting Hub V2.xlsm").Activate
Sheets("Raw Data").Visible = True
Sheets("Raw Data").Select
Columns("A:N").EntireColumn.Select
ActiveSheet.Paste
Sheets("Raw Data").Visible = False
Sheets("Title Page").Visible = True
Windows("Central Reporting Hub Raw Data-en-au.xlsx").Activate
ActiveWorkbook.Saved = True
Windows("Central Reporting Hub Raw Data-en-au.xlsx").Application.CutCopyMode = False
ActiveWindow.Close
Dim pt As PivotTableDim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.RefreshTable
Next pt
Next ws
End Sub
However the issue lies in that once the data is refreshed, the slicers reading off the above raw data/pivots, automatically select all weeks, however this is not beneficial for the data being presented.
Is there anyway to have, once the Pivots have been updated, for the macro to then check and select current week range (beginning Monday) only?