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

Macro Command Button incl. vlookup

vity

New Member
Hi All,
I am very beginner in VBA, but not in excel. I have made a command button with macro: it is on "dashboard" sheet, and opens the Grand Total result list from a Pivot-table on "Pivot" sheet (just like double-clicking on the Pivot-table Grand Total value). But the content (length) of this Pivot-table changes according to slicers on "dashboard". I was only able to record the macro pointing the actual place of Grand Total value and double-click, but not able to add vlookup finding always the Grand Total value in that range. Could you help me please? Thanks in advance, Vity
 

Attachments

  • command_button.xlsm
    218 KB · Views: 13
Try this:

Code:
Sub Grand_Total()
    With Sheets("Pivot").PivotTables(1).TableRange1
        .Cells(.Cells.Count).ShowDetail = True
    End With
End Sub
 
Hi Debaser,
Thank you very much for your quick help!
I have to make 5 more buttons, I hope I will be able to do it.
KR, Vity
 
Back
Top