Change Range Names with VBA Macro.

dsorensen

New Member
Joined
Apr 3, 2014
Messages
7
I am trying to change some range names on different sheets so I can do this faster than doing it manually. I have about 30 ranges for each sheet and they are all named Prop___ i.e. Prop1, Prop2, PropLAE1, PropSUB1... and I want to change them to CovA___.
I need to do this for 5 different sheets so if there is a VBA script to do this with out having to name all of the ranges that would be great. I have excel 2013 professional if that changes anything.

Thanks in advance.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
I closed everything down and it worked. Now i get to figure out how to do this for a single sheet instead of the whole workbook.
Thanks for all of your help.
 
Upvote 0
Thank you for the code above as it worked for me, too. But I haven't figured out how to modify it so that it only worked on the active worksheet?

Sub ChangeName()
Dim Nam As Name
For Each Nam In ThisWorkbook.Names
Nam.Name = WorksheetFunction.Substitute(Nam.Name, "22", "21")
Next Nam
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,276
Messages
6,124,006
Members
449,137
Latest member
abdahsankhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top