+ Reply to Thread
Results 1 to 8 of 8

Code to List Named Ranges for each Sheet not working

  1. #1
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Code to List Named Ranges for each Sheet not working

    Hello!

    I have a Tester Workbook from which I run code on other workbooks.

    What I wanted is to go through each sheet in the examined workbook and then make a list of the named ranges from each sheet to a new sheet.

    I found RoyUk's code on this forum and tried to modify it. but I messed something up.

    It makes a new sheet, but it is not going through each sheet and the names on those sheets properly.

    Here's the code:

    Please Login or Register  to view this content.
    I appreciate the help!

    Lost
    Last edited by leaning; 04-12-2012 at 03:23 PM. Reason: edit wording

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Code to List Named Ranges for each Sheet not working

    If you have not already, I would strongly suggest the Name Manager add-in. It's a must for heavy workbooks and should do what you are after with ease.

    http://www.jkp-ads.com/officemarketplacenm-en.asp
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Code to List Named Ranges for each Sheet not working

    Hello,

    I wrote for you following code - it should cover your needs
    Please Login or Register  to view this content.
    Last edited by MaczaQ; 04-13-2012 at 08:26 AM.
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  4. #4
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Question Re: Code to List Named Ranges for each Sheet not working

    Maczaq,

    I appreciate your help!

    If the workbook to be examined has 10 sheets, there should be either 10 ReportSheets (one for each sheet), or preferably, all the names from each of the sheets all on one ReportSheet (names for sheet1 in rows 1-15, names for sheet2 in rows 16-18, etc.)

    Your code just looks at the activesheet, not all the sheets.

    Any ideas?

    AlvaroSiza: Users here prefer macros over add-ins. Thanks for the feedback!

    Respectfully,

    Lost

  5. #5
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Code to List Named Ranges for each Sheet not working

    hi again

    I think my code works for all names defined in activeworkbook
    here is a little update
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Code to List Named Ranges for each Sheet not working

    MaczaQ,

    Almost there.

    Where do I put it in your code so that it also displays the sheet name that named range is on? I don't care if the report repeats data. I just want it to positively identify that a certain range is workbook level or sheet-level, and if sheet-level, what sheet it is on.

    SheetName NamedRange Refers to Sheet or Workbook Level
    Sheet1 Dog Sheet1!A1 Sheet
    Sheet1 Cat .....etc.

    Thanks!

    Lost
    Last edited by leaning; 04-16-2012 at 09:56 PM. Reason: correct wording

  7. #7
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Code to List Named Ranges for each Sheet not working

    MaczaQ/All,

    This code never worked exactly like I wanted it to, but I found a better one (and it's free):
    Jan Karel Pieterse's Name Manager: http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.asp

    The undoubted shiznit when it comes to showing everything there is about your Named Ranges (both workbook/global- and sheet-level).

    Thanks!

    Lost

  8. #8
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Code to List Named Ranges for each Sheet not working

    Quote Originally Posted by AlvaroSiza View Post
    If you have not already, I would strongly suggest the Name Manager add-in. It's a must for heavy workbooks and should do what you are after with ease.

    http://www.jkp-ads.com/officemarketplacenm-en.asp
    Quote Originally Posted by leaning View Post
    AlvaroSiza: Users here prefer macros over add-ins.
    You landed where I originally suggested. Perhaps a bit more patience next time. We are here to help. Glad you are happy with the add-in.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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