VBA Change "Cell Reference In Formulas" To "Range Names In Excel" for a whole workbook

actjfc

Active Member
Joined
Jun 28, 2003
Messages
416
Excel friends,

Let's say wherever this vlookup(?,$B5:$C25,2,0) shows up in a Workbook. If I have defined a name for all ranges, and $B5:$C25 is Prices, then the VBA code should replace the vlookup to show: vlookup(?,Prices,2,0). I would like to find a VBA code to perform this kind of replacement in a whole workbook:

The macro should perform just as explained here:
https://www.extendoffice.com/documents/excel/846-excel-change-cell-reference-to-name.html

Can somebody help to develop it or point out where to find open source code?

Thanks!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Perhaps you could tell us a bit more about your circumstances that mean you couldn't just manually follow what is described in the link you provided. Since you can select all the names and apply them simultaneously, what is it about your circumstances that precludes that? Is it just that you have multiple worksheets in your workbook, or something else?
 
Upvote 0
I am sorry for my delayed response. Labor Day delay! Yes, I have multiple workbooks and about 1500 references. I feel more in charge if I know and see the VBA code. I will take a look at thespreadsheetguru code, and see how I can make a loop to make it work. I plan first to identify all references used in the workbook generating a two column list, and them apply the macro to create the names. Also, some of them may be local and other global. The regular Excel way to do it runs behind scenes, I like to own the code. If anybody has already something is highly appreciated. Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

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