Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Pivot Tables and macro

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dear MrExcel,

    I have been working with Pivot tables for a long period and getting more and more triks from experience and your useful web. Now, I'm trying to improve a file for data analysis by using macros connected with Pivot tables. My question is:

    żIs there any way to execute a macro each time I select an option of the Pivot Table?

    I'd appreciate very much your answer,
    thank in advance

    Francisco

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Brampton
    Posts
    328
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Use a Worksheet_Change event procedure for the worksheet containing the pivot table.Open Project Explorer (Ctrl+R), locate the workbook, expand for worksheet objects and double click on the appropriate worksheet icon. When the code window opens, select the Change event and insert the code to be run.

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks a lot for the advice.
    I would like to have your comments to the following case related to the same issue:

    When I use the calculate event procedure for the worksheet containing my Pivot Table it works well. Howewer, when I try to modify or change any cell in other worksheet or workbook the macro is also executed. I noticed this happens only when there is a function INDIRECT included in the worksheet containing the pivot table.

    Is seems that INDIRECT function forces the activation of the change/calculate event procedure after any change in any sheet or workbook. (although the procedure is just associated to worksheet1)

    żdo you know how to solve this unwished activation of the event?

    regards
    Francisco (frajaro)



Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •