nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 598
- Office Version
- 2019
- Platform
- Windows
I am trying to get my Macro to build a Pivot Table. Currently it is only grabbing data to line 1140, i need the macro to automatically grab all data in the source sheet. This is what i have currently:
what do i need to do to always grab the full data set in the sheet?
VBA Code:
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Load Data!R1C1:R1140C14", Version:=6).CreatePivotTable TableDestination:= _
"Pivot!R1C1", TableName:="PivotTable1", DefaultVersion:=6
Sheets("Pivot").Select
what do i need to do to always grab the full data set in the sheet?