find row in datatable when click on cell in pivot table

  • Hi,


    Normal situation: double click on a cell in a pivottable: the relating row from the data table is placed in a new sheet.


    But is it possible (through vba) to select, and go to, the relating row in the data table by clicking in a cell in the pivot table.


    Hope it is.


    Thx


    aisietie

  • Re: find row in datatable when click on cell in pivot table


    Yup....


    .ShowDetail is what you need.


    You can "showdetail" on a worksheet cell (if the cell is part of the pivot table), or on a pivot table item, or on a pivot table field. Here is an example of using it on a cell....


    Code
    Sub Macro1()
    
    
        Worksheets("Sheet1").Range("K19").ShowDetail = True
        
    End Sub


    Assuming cell K19 was in your Pivot Table, it would expand like a double click.


    Ger

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

  • Re: find row in datatable when click on cell in pivot table


    Hi,


    Thanks for the reply, this is interesting, but not exactly what I want.


    The pivottable is on Sheet A. The Masterdata is on Sheet B.
    With the macro above, a new page "Sheet 1" is generated with the info. That is not good for me.
    I want to be redirected to the masterdata Sheet B, to the specific row.


    Thx


    aisietie

  • Re: find row in datatable when click on cell in pivot table


    All,


    It is OK.
    What do I do:


    In the pivottable I double click in the cell wich I want to see the info. A new page is generated, and then I run a macro wich sets advanced filter in the data table.
    Then I get the corresponding row in the data table.


    Thx anyway.


    aisietie

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!