+ Reply to Thread
Results 1 to 7 of 7

Is there a way to batch update named ranges?

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Is there a way to batch update named ranges?

    Afternoon everyone,

    I have a spreadsheet where I created about 100 named ranges, they all start in column L and go to column AE. However, it turns out I didn't look far enough into the future when I was planning my spreadsheet and I now need to extend all of the ranges so that they go to column AM.

    Is there a quick way to do this (bearing in mind I have 100 odd names)? or am I going to have to go into the name manager, work my way down the list and change AE to AM for every one?

    Anyones help is much appreciated.

    Thanks,

    Alice

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Is there a way to batch update named ranges?

    A short macro like this should do the job for you:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Is there a way to batch update named ranges?

    Cut some code

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Is there a way to batch update named ranges?

    Thanks Andrew-R however when I try that I get a Runtime 1004 error saying that the name is not valid (and then the usual reasons, spaces, already exists, doesn't begin with a letter...)

    It's almost like the code is renaming the actual name rather than the range - although I would have thought that's what the .refersto bit was supposed to do.

    ....any ideas?

    Thanks,

    ---------- Post added at 01:32 PM ---------- Previous post was at 01:29 PM ----------

    Bob - if I was going to use your method then I guess I would have to list out all my range names in, this bit

    Please Login or Register  to view this content.
    Also where does it specifiy where I would want to extend the range to?

    Forgive me if these are stupid questions - VBA is all very new to me!

    Thanks,

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Is there a way to batch update named ranges?

    Quote Originally Posted by qaliq View Post
    ]Bob - if I was going to use your method then I guess I would have to list out all my range names in, this bit

    Please Login or Register  to view this content.
    That is so.

    Quote Originally Posted by qaliq View Post
    Also where does it specifiy where I would want to extend the range to?
    Where it says

    Please Login or Register  to view this content.
    the original range is being resized by 1 column. You would need to change that to + 8 to increase from AE to AM.

  6. #6
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Is there a way to batch update named ranges?

    Ok great, quick question then...is there a way that I could get excel to list out all my range names (as a continuous list rather than cell by cell like it would do if I did paste names)?

    Thanks,

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Is there a way to batch update named ranges?

    Please Login or Register  to view this content.


    ---------- Post added at 02:47 PM ---------- Previous post was at 02:45 PM ----------

    If all names are to be updated, you could use

    Please Login or Register  to view this content.

+ 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