Pinterest Pixel

Disable/Enable Get Pivot Data Using Macros In Excel

When you wanted to reference a cell in a Pivot Table, a GETPIVOTDATA formula shows up instead.... read more

Download Excel Workbook
Bryan
Posted on

Overview

Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline

When you wanted to reference a cell in a Pivot Table, a GETPIVOTDATA formula shows up instead. If you want to have just a normal cell reference show up, you can disable/enable get pivot data using Excel Macros!

Disable/Enable Get Pivot Data Using Macros In Excel

Make sure your Excel has the Developer Tab enabled following this tutorial.

I explain how you can do this below step by step!

What does it do?

Disable / Enable Get Pivot Data

Copy Source Code:


Sub EnableGetPivotData()
Application.GenerateGetPivotData = True
End Sub

Sub DisableGetPivotData()
Application.GenerateGetPivotData = False
End Sub

Final Result: 

Disable/Enable Get Pivot Data Using Macros In Excel

Exercise Workbook:

Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline

Download excel workbookDisable-Enable-Get-Pivot-Data.xlsm


Here is our pivot table:

Disable/Enable Get Pivot Data Using Macros In Excel

If we try to create a formula involving one of the cells inside the Pivot Table, you will see the GETPIVOTDATA Formula. Let us change this behavior using Macros!

Disable/Enable Get Pivot Data Using Macros In Excel

STEP 1: Go to Developer > Code > Visual Basic

Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline

 

STEP 2: Paste in your code and Select Save. This will create two options for you to choose either to enable or disable. Close the window afterwards.

Disable/Enable Get Pivot Data Using Macros In Excel

 

STEP 3: Let us test it out!

Open the sheet containing the data. Go to Developer > Code > Macros

Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline

 

Make sure your disable macro is selected. Click Run.

Disable/Enable Get Pivot Data Using Macros In Excel

 

Try referencing a cell inside the pivot table again. It is now a normal cell reference.

With just one click, we have disabled get pivot data!

 Disable/Enable Get Pivot Data Using Macros In Excel

 

How to Disable/Enable Get Pivot Data Using Macros In Excel

 

101 Macros Book

If you like this Excel tip, please share itEmail this to someone

email

Pin on Pinterest

Pinterest

Share on Facebook

Facebook

Tweet about this on Twitter

Twitter

Share on LinkedIn

Linkedin

Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline
Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline
Bryan

Bryan is a best-selling book author of the 101 Excel Series paperback books.

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!