Bulk update of formula ranges in name manager

Tristo

New Member
Joined
Aug 25, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hey All,
Was hoping for some help in regards to a bulk update of all the line items in the name manager. Currently the ranges under the "Refers to" all start from the column T and I need to change them to start from the column H.
Started updating them manually but quickly realized that I would be here all day if trying to do all 3,500 of them. Figured there was a quick macro I could run that looks for the letter T and replaces with the letter H but I'm rubbish when it comes to setting them up so any help would be appreciated.
Thanks.
 

Attachments

  • EG.png
    EG.png
    72.1 KB · Views: 250

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi & welcome to MrExcel.
How about
VBA Code:
Sub Tristo()
   Dim Nm As Name
   
   For Each Nm In ThisWorkbook.Names
      If InStr(Nm.RefersTo, "$T$") Then Nm.RefersTo = Replace(Nm.RefersTo, "$T$", "$H$")
   Next Nm
End Sub
 
Upvote 0
Hi & welcome to MrExcel.
How about
VBA Code:
Sub Tristo()
   Dim Nm As Name
  
   For Each Nm In ThisWorkbook.Names
      If InStr(Nm.RefersTo, "$T$") Then Nm.RefersTo = Replace(Nm.RefersTo, "$T$", "$H$")
   Next Nm
End Sub
Hey Fluff,
That worked a treat. Thanks for your help, much appreciated!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Hi

I know this is an old thread but wondered if someone might be able to help.

Total novice here. The above VBA works really well but I wondered if there was a way in which I could insert something into the formula rather than removing it. For example, currently my name manager refers to =Sheet1!$J$1 but I want to bulk change this to =Files(Sheet1!$J$1). I would do it manually but I have about 5000 cells. If someone can help that would help me massively.

Thanks
Sam
 
Upvote 0
As this is significantly different from the original question, please start a thread of your own. Thanks
 
Upvote 0
I wish that when you told Samuel_96 that his 2nd question needs to be in a new thread, that there could be a link to that thread. I would love to know the answer to his 2nd question.
 
Upvote 0
Samuel_96 never started a new thread so there is nothing to link to.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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