+ Reply to Thread
Results 1 to 8 of 8

Use Pivot item name to be new worksheet's name

  1. #1
    Registered User
    Join Date
    06-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Use Pivot item name to be new worksheet's name

    Hi,

    When we double click on an item from a pivot table, a new sheet will be created.

    I would like to use the item name in the pivot table to be the new worksheet's name when i double on that item.

    Is there a way to do this?

    Please see attached file for more info.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Use Pivot item name to be new worksheet's name

    Right click Pivot sheet tab and click View Code. Paste following

    Please Login or Register  to view this content.
    In Thisworkbook object paste the following
    Please Login or Register  to view this content.
    In a standard code module paste the following
    Please Login or Register  to view this content.
    Currently the code does not deal with duplicate sheet names.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Use Pivot item name to be new worksheet's name

    Thanks a lot for your help.

  4. #4
    Registered User
    Join Date
    06-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Use Pivot item name to be new worksheet's name

    Quote Originally Posted by Andy Pope View Post
    Right click Pivot sheet tab and click View Code. Paste following

    Please Login or Register  to view this content.
    In Thisworkbook object paste the following
    Please Login or Register  to view this content.
    In a standard code module paste the following
    Please Login or Register  to view this content.
    Currently the code does not deal with duplicate sheet names.
    Hi Andy,

    I did not get it to work correctly...
    Can u pls help? I have attached a copy of the example with the codes.. Pls let me know where i am going wrong... thanks a million...
    Attached Files Attached Files

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Use Pivot item name to be new worksheet's name

    I just double clicked in B5 and it created a new sheet called Apples.

    What exactly does not work for you?

  6. #6
    Registered User
    Join Date
    06-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Use Pivot item name to be new worksheet's name

    Quote Originally Posted by Andy Pope View Post
    I just double clicked in B5 and it created a new sheet called Apples.

    What exactly does not work for you?
    I think i know why it is not working... i have another pivot table in another tab. Can the script be amended so that it can work with more than 1 pivot table in the workbook?

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Use Pivot item name to be new worksheet's name

    Please don't quote previous responses unless relevant, it just clutters the thread.

    remove that code and paste this in the Thisworkbook object. It will work for the first pivot table on any sheet.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Use Pivot item name to be new worksheet's name

    Thanks for your help Andy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1