larinda4
Board Regular
- Joined
- Nov 15, 2021
- Messages
- 74
- Office Version
- 365
- Platform
- Windows
I'm not the greatest with macros and I generally use the record a macro and play around with it until it does what I want. I recorded creating a pivot table, placing it in an existing sheet and when I delete the pivot table and try to run the macro again to confirm it works, I am receiving a Run Time Error 5, invalid procedure call or argument.
Here is my code:
Range("A1:U7591").Select
Anyone know what I'm doing wrong? I also want to make the row count automatic, as it changes every month when I do my reporting. It will always be column U, but a different row number.
Any help is greatly appreciated!
Here is my code:
Range("A1:U7591").Select
VBA Code:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Firm Listing!R1C1:R7591C21", Version:=15).CreatePivotTable TableDestination _
:="my-benefits!R1C1", TableName:="PivotTable6", DefaultVersion:=6
Sheets("my-benefits").Select
Anyone know what I'm doing wrong? I also want to make the row count automatic, as it changes every month when I do my reporting. It will always be column U, but a different row number.
Any help is greatly appreciated!