• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Pivot Table Report Filter value need to change with VBA

I have Total 3 sheets
Sheet 1 = List of states
Sheet 2 = Raw Data with contains City
Sheet 3 = Is Pivot

VBA code required for If i click any State i want to get the pivot refreshed with the state which i was clicked. PFA of sample sheet without macros
 

Attachments

Hi ,

The property Application.Caller is returning the name of the button which has been clicked , such as Button 1 , Button 2 , Button 3 ,...

Using the construct :

Activesheet.Buttons(Application.Caller)

will return any of the following , depending on which button was clicked :

Activesheet.Buttons("Button 1")

Activesheet.Buttons("Button 2")

Activesheet.Buttons("Button 3")

and so on.

When we take the Caption property of the button which was clicked , we will get State 1 , State 2 , State 3 ,...

This is used to set the Report Filter of the Pivot Table.

Narayan
 
Hi ,

The property Application.Caller is returning the name of the button which has been clicked , such as Button 1 , Button 2 , Button 3 ,...

Using the construct :

Activesheet.Buttons(Application.Caller)

will return any of the following , depending on which button was clicked :

Activesheet.Buttons("Button 1")

Activesheet.Buttons("Button 2")

Activesheet.Buttons("Button 3")

and so on.

When we take the Caption property of the button which was clicked , we will get State 1 , State 2 , State 3 ,...

This is used to set the Report Filter of the Pivot Table.

Narayan
Can you help me with the buttons in next sheet. I dont want the button in same sheet. please dont mistake me..
 
Back
Top