Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Apr 2009
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    How to record the pivot table in marco recording. we are using same function repeatedly.

    VV

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Welcome to the Lounge!

    The macro recorder tends to record specific actions, so if you want to be able to reuse it, you'll probably have to edit the recorded code to make it more general.

    If you could provide an example of what you want to accomplish, someone might be able to help you.

  3. #3
    New Lounger
    Join Date
    Apr 2009
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Hans

    Good Morning.

    In the attached the name of the persons is repeated several times and order qtys also repeately. for that i need Pivot table. once i record the pivot table in marco recording, next when i entered the different names and order qty and press the marco run button it will automatically operate.

    VV
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You don't really need a macro for that.

    You can define a dynamic named range that will expand and shrink automatically, and use this as data source for the pivot table.
    (See here for info about dynamic ranges)

    When you add, remove or edit data, you only have to refresh the pivot table:
    [attachment=83403:z.png]

    See the attached version of the workbook.
    [attachment=83404:New_Micr...orksheet.xls]
    Attached Images Attached Images
    • File Type: png z.png (7.7 KB, 2 views)
    Attached Files Attached Files

  5. #5
    New Lounger
    Join Date
    Apr 2009
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Hans,

    Thanks for clarification,

    But i need Pivot table macro recording, some times fields may changed.

    VV

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Do you want a macro that creates a new pivot table? If new columns (fields) have been added, it's not a priori clear how they should be handled, so it's difficult to imagine what such a macro would look like...

  7. #7
    Lounger
    Join Date
    Mar 2009
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In trying to learn this for myself, I put together this example the other day. Fields can be set/adjusted within the code to create a basic format.
    Attached Files Attached Files

  8. #8
    New Lounger
    Join Date
    Apr 2009
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi dmackillop,

    can you share the procedure for two field, some times the new items also added in the list and some times few items are deleted.

    Output should be in same sheet n the same sheet.

    pls share the macro recording steps.

    VV
    Attached Files Attached Files

  9. #9
    Lounger
    Join Date
    Mar 2009
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, the macro was not recorded. Can you add a pivot table to your sheet, as you would like to see it.

Posting Permissions

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