VBA Error on a Macro When Used in Conjunction With a Pivot Table

robman63

New Member
Joined
Nov 6, 2017
Messages
4
Hi!

I have pivot table that consists of 3 elements

Left Column is a store name
Next Colum of Table is a Grand total field of Sold Quantity and Unsold Quantity of items.

I created 4 macros and assigned them to 4 different buttons :

1. Show Salesperson Name
2. Hide Salesperson Name
3. Show Manager's Name
4. Hide Manager's Name

I recorded these macros in the order shown above.

The problem comes in when I try to click only on Macro 3 because when the macro was written the Salesperson's name was already there.

In order to have an error-free experience and see the Manager's name you need to click on both in that order.

Is there a statement that can be added to the vba code to circumvent this issue?

Thanks in advance!!!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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