Using VBA to name the ranges within a PivotTable

SamBord

New Member
Joined
Sep 23, 2013
Messages
1
Hi,

My Excel sheets need to have a number of conditional drop down lists. To do this I currently use a fairly lengthy process of =INDIRECT formulas with Data Validation.

I want to start using PivotTables more but I wish that each filed within a PivotTable was a named range that would update when the table is refreshed. I already use GETPIVOTDATA but I'd love to be able to run some code to name each row/column/data range.

I found an article here that I think should do what I want, but I can't get it to run.
http://yoursumbuddy.com/create-pivot-table-named-ranges/

Specifically Regex_replace function doesn't seem to work.

If anyone has any ideas or has already written something similar I'd be very grateful!

Thanks
Sam
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top