ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Changing name ranges (https://www.excelbanter.com/excel-discussion-misc-queries/202312-changing-name-ranges.html)

chillibean

Changing name ranges
 
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?


Mattlynn via OfficeKB.com

Changing name ranges
 
you could put an offset formula as the range for the names range

=OFFSET(name of tab here!$m$255,0,0,COUNTA(name of tab here!$M:$M),COUNTA
(name of tab here($1:$1))



chillibean wrote:
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?


--
Matt Lynn

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200809/1


Don Guillett

Changing name ranges
 
One way

Sub changename()
old a1:b21
Range("a1:x21").Name = "myrng"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"chillibean" wrote in message
...
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?



Gary''s Student

Changing name ranges
 
How about:

Sub namextender()
For Each n In ActiveWorkbook.Names
n.RefersTo = Replace(n.RefersTo, "$AP$", "$BB$")
Next
End Sub
--
Gary''s Student - gsnu200804


"chillibean" wrote:

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?



All times are GMT +1. The time now is 09:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com