none
How to navigate between two worksheets in excel pivot table RRS feed

  • Question

  • How to navigate between two worksheets in excel pivot table like if i click on one cell  B6 in sheet1 i want to go sheet2.

    How can we write VBA Code for this ?

     

    Saturday, August 13, 2016 6:14 PM

Answers

  • An idea to get you started:

    Create two worksheets, Sheet-A and Sheet-B.

    In Sheet A VBA code section enter:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Address = "$B$6" Then Worksheets("Sheet-B").Activate
    End Sub

    In Sheet B VBA code section enter:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Address = "$B$6" Then Worksheets("Sheet-A").Activate
    End Sub

    Note that you need to change focus from B6 before you click it again to change worksheet.


    Best regards, George

    Sunday, August 14, 2016 1:00 PM