Pivot Table Update Change event

libby845

New Member
Joined
May 8, 2017
Messages
15
Hello - I have a pivot table change event that runs on pivot table update.

This process works great, provided the changes occur on the sheets that the pivot tables reside. However since we have multiple sheets with multiple pivots my users wanted a "workbook control sheet" added that contains a series of slicers. The catch is that they want the "focus" to remain the on workbook control sheet while the slicers are being set. To accommodate that, I added the line after the call to the macro to select the "workbook controls sheet". That problem was solved. However, the problem I caused by doing this is if the user is on one of the pivots on the other worksheets and makes a change, such as using the + or - to expand or collapse items within the pivot the user is bounced to the "workbook controls" sheet. This is not the desired result. Ideally if the user is making a change on the sheet that contains the pivot the desire is to remain on that sheet.

Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Sheets("Units of Service").Select
Call Row_Hider
Sheets("Workbook Controls").Select
End Sub

Is there a way to code the above to only bounce to the workbook controls sheet if the change originated from that sheet?

Above is the code I used to call the macro. The actual intent of the macro is to hide the unused rows between multiple stacked pivot tables within a sheet which is why I want it to run the macros on any pivot table change event. The Row_hider macro and the event all worked great until we needed to add the Workbook control sheet. Any advice is appreciated!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,223,276
Messages
6,171,140
Members
452,381
Latest member
Nova88

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