• 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.

How to link ActiveX Control button to a Pivot Table [SOLVED]

Raja Kamarthi

New Member
Hi,


Please let me know how to link a Active X control button to a pivot table. I have list of names in the drop down button and a pivot table with the same list of names & data. Now all I need is when I select a particular name in the drop down, the pivot table should have the same name selected


Regards,

RK
 
I'd record yourself changing the PivotTable dropdown, and then use that code within the ActiveX control, something like:

[pre]
Code:
Private Sub ComboBox1_Change()
'Replace "PivotTableChangeCode" with appropriate reference
PivotTableChangeCode = ComboBox1.Value
End Sub
[/pre]
 
Hi Luke,


Tried using your inputs but couldnt figure out, please refer to the sample file and assist me in getting the desired result


https://www.dropbox.com/s/l3arfyvxqr9vtus/MTD.xlsm


Regards,

Raja
 
Hi, R K!

This is one of those usual cases of the (useful for him!) CASFFML issue that suffers Luke M.

Try placing this code instead of in a module in the class module of the related worksheet (Sheet4):

-----

[pre]
Code:
Option Explicit

Private Sub ComboBox1_Change()
ActiveSheet.PivotTables("PivotTable1").PivotFields("name").CurrentPage = ComboBox1.Value
End Sub
[/pre]
-----

Regards!


PS: CASFFML stands for can't access shared files from my location :=)
 
Hi, R K!

Glad you solved it. Credit to Luke M, I just intermediate. Thanks for your feedback and for your kind words too. And welcome back whenever needed or wanted.

Regards!
 
Back
Top