Hi,
I am very new to VBA and am trying to allow users to press a button on one page that will launch a macro for a different worksheet. I intend to assign a button for them to press that will generate a new worksheet for each inputter. I modified the code after creating a macro for it. The macro works fine when I run from the active sheet. I can't figure out how to change the code so that it runs from anywhere in the workbook. It is failing at the section in bold. My worksheet name is 'Pivot' and the pivot table itself is called 'MainPivot'. My apologies I can't upload my workbook. I am restricted because of security at work.
Sub PivotMacro()
Range("A4").Select
ActiveSheet.PivotTables("MainPivot").PivotCache.Refresh
ActiveSheet.PivotTables("MainPivot").ShowPages PageField:="Inputter_Name"
End Sub
any help greatly appreciated
Bookmarks