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 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 it
Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline
Disable/Enable Get Pivot Data Using Macros In Excel | MyExcelOnline
Bryan

Bryan Hong is an IT Software Developer for more than 10 years and has the following certifications: Microsoft Certified Professional Developer (MCPD): Web Developer, Microsoft Certified Technology Specialist (MCTS): Windows Applications, Microsoft Certified Systems Engineer (MCSE) and Microsoft Certified Systems Administrator (MCSA).

He is also an Amazon #1 bestselling author of 4 Microsoft Excel books and a teacher of Microsoft Excel & Office at the MyExecelOnline Academy Online Course.

See also  Highlight Active Row & Column by Double Click Using Macros In Excel

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!

Share to...