I have a worksheet with 3 tabs. One where data is recorded, one with high level summary, and one with detailed summary. The 2nd and 3rd tab mention contain pivot tables.
I added a button on the first tab / data tab, to update all pivot tables. (I'm a VBA rookie so I was proud of that.) BUT I'm annoyed that at the end of the macro, the active sheet is the third tab. I'd really like it to either remain on the first tab where the button was ('data' tab) or at least to flip through the other tabs while it updates and at the end flip back to the tab with the button ('data').
Here's the code I have in the button.
-------
Sub Button5_Click()
Sheets("High Level- Rolling Scores").Select
ActiveSheet.PivotTables("DetailedPivot").RefreshTable
Sheets("Detailed- date, course, trainer").Select
ActiveSheet.PivotTables("SummaryPivot").RefreshTable
End Sub
-------
Any advice before I pull my hair out? Or am I stuck just being annoyed every time I use the 'refresh' button I've made?
TIA!
Edited to add - I know I misnamed by Pivot tables and the summary is on the detailed and the detailed is on the high level... BUT I got it working so I didn't want to mess with it... again, VBA rookie!![]()
Bookmarks