Hi
I am trying to record a macro that takes a set of data, re-formats it in a way I would like, then creates a Pivot table with certain field categories in it.
The trouble I am having -- I think-- is that I am trying to make this work for any set of data no matter the sheet name. We get this data with different sheet names, but obviously when I record the macro it will record to create the pivot table off a sheet with a specific name.
How do I change the VBA code so that this macro will work on any sheet it is in, and not only the one named with the macro I set out?
When bypassing this, if the code makes it to the pivot table, it is unable to add the correct fields to it, giving me run time error 5. Attached are two screenshots of the code. Thank you!
snip1.PNG
snip2.PNG
Bookmarks