Changing name ranges

C

chillibean

I am using a workbook that contains hundreds of range names. I need to extend
all of the ranges so the ranges run to column BB instead of column AP as
they do now.

For example a named range is currently $M$255:$AP$255 and needs changing to
$M$255:$BB$255

Is their any way I can do the changes in one go instead of going through
Insert – Name – Define, and changing them all manually?
 
G

Gary''s Student

How about:

Sub namextender()
For Each n In ActiveWorkbook.Names
n.RefersTo = Replace(n.RefersTo, "$AP$", "$BB$")
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top