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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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,945
Messages
6,127,844
Members
449,411
Latest member
adunn_23

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