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!
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!