View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Rename all named ranges?

Bob supplied code to rename the names, but that code won't fix any formulas.
Those will be broken after Bob's code runs.

If those range names are unique strings....

You may be able to run Bob's code (without the nme.delete line)

Then do a bunch of edit|replaces through each worksheet to replace the old
names with the new names.

Then go back to delete the old names.

But this won't affect names used in other names (insert|name) or any VBA code
either!

If you had a specific pattern of names (or list of names), then you may get more
responses on what to do--but whatever you do, make sure it's against a copy of
your workbook. Too much could go wrong.

And since you're working with names...

Get Jan Karel Pieterse's (with Charles Williams and Matthew Henson) Name
Manager to make checking those names easier.

You can find it at:
NameManager.Zip from http://www.oaltd.co.uk/mvp

===
And get Bill Manville's FindLink program:
http://www.oaltd.co.uk/MVP/Default.htm

To help find any thing you broke after you do this change.



Bob Phillips wrote:

You can't use R1, but you could use R_

Dim nme As Name

For Each nme In ActiveWorkbook.Names
ActiveWorkbook.Names.Add Name:="R_" & nme.name,
RefersTo:=nme.RefersTo
nme.Delete
Next nme

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Johan" wrote in message
ups.com...
Excel 2000

I have a workbook with 100+ named ranges. I would like to rename them
all. Starting all names with "R1" and the old name. I would also like
all the formulas in the workbook that refers to the names be changed
to the new names. (perhaps this happened automatically?)

Thanks

Johan


--

Dave Peterson