+ Reply to Thread
Results 1 to 4 of 4

Looping through named ranges to rename them

  1. #1
    Forum Contributor
    Join Date
    11-17-2004
    MS-Off Ver
    Office 2016
    Posts
    527

    Looping through named ranges to rename them

    I have the following code bits that allow me to change the name of a single named range but I'd like to loop through all of the names I have (except Print_Area and Print_Titles) and add a user prompted prefix to all of them. The code below allows me to perform this and I could just repeat the NewValue/OldValue/Call lines multiple times but I have a lot of named ranges and I won't always know the names.

    Could I get some assistance in created a loop to cycle through all my named ranges and add the prefix?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Looping through named ranges to rename them

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    11-17-2004
    MS-Off Ver
    Office 2016
    Posts
    527

    Re: Looping through named ranges to rename them

    With a slight modification to exit when nothing is entered this performed perfectly....thank you!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Looping through named ranges to rename them

    Quote Originally Posted by JimDandy View Post
    With a slight modification to exit when nothing is entered this performed perfectly....thank you!
    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA creates named ranges, but named ranges disappear
    By BrotherNeptune in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2015, 03:22 PM
  2. Define only 2 named ranges from a list of named ranges...
    By abhi900 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-29-2014, 04:20 AM
  3. Looping Mutliple Named Resized Ranges in next empty row below another named range
    By gingumdog in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2014, 08:15 PM
  4. Looping Named Ranges
    By jensenleesen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2011, 10:07 PM
  5. Named Ranges and looping
    By Tiff750 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2008, 02:38 PM
  6. Script Looping and will not rename my sheet
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2008, 05:48 PM
  7. Looping through named ranges
    By JFamilo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2005, 09:23 AM

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