Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to replace range names with cell references in Excel?

Author Tech Support Last modified

When working with named ranges in Excel, you might find them useful for readability and formula management. However, there are situations where you may want to remove range names and restore actual cell references, especially when sharing files, troubleshooting, or standardizing templates. In this article, we will walk through different ways to replace named ranges with their corresponding cell references in Excel.

Replace range names with cell references by VBA code

Quickly and easily replace range names with cell references by Kutools for Excel

For example, in this worksheet, I will name range A2:A6 as saleprice, and name B2 as discount, and then using both the range name in a formula to calculate the new price. See screenshots:

range name data sample 1    range name data sample 2     range name data sample 3

After following the quick tricks, the range name will be replaced with cell reference as shown as below:

convert range names to cell references


Replace range names with cell references by VBA code

Using VBA to replace formula’s range names with cell references, you can get it done step by step as follows:

1. Select the range containing the formulas you want to replace their names with cell references.

2. Press Alt + F11 to open a new Microsoft Visual Basic for applications window will display, then, click Insert Module, and copy nad paste the following codes in the module:

VBA code: Replace range names with Absolute reference

Sub AbsoleteNamesWithRelativeRefs()
'Updateby Extendoffice
Dim Rng As Range
Dim WorkRng As Range
Dim xName As Name
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Set WorkRng = WorkRng.SpecialCells(xlCellTypeFormulas)
For Each Rng In WorkRng
    For Each xName In ThisWorkbook.Names
        If InStr(Rng.Formula, xName.Name) > 0 Then
            Rng.Formula = VBA.Replace(Rng.Formula, xName.Name, VBA.Replace(VBA.Replace(xName.RefersTo, "=", ""), "$", ""))
        End If
    Next
Next
End Sub

VBA code: Replace range names with relative reference

Sub ReplaceNamesWithRelativeRefs()
'Updateby Extendoffice
Dim Rng As Range
Dim WorkRng As Range
Dim xName As Name
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Set WorkRng = WorkRng.SpecialCells(xlCellTypeFormulas)
For Each Rng In WorkRng
    For Each xName In ThisWorkbook.Names
        If InStr(Rng.Formula, xName.Name) > 0 Then
            Rng.Formula = VBA.Replace(Rng.Formula, xName.Name, VBA.Replace(xName.RefersTo, "=", ""))
        End If
    Next
Next
End Sub

3. Then press F5 key to run the code, a dialog displays for selecting a range to replace. See screenshot:
convert range names to cell references with vba code

4. Then click OK. and all of the selected formula range names have been replaced.


Quickly and easily replace range names with cell references by Kutools for Excel

While doing this manually or through VBA can be time-consuming and error-prone, Kutools for Excel provides a one-click solution to simplify the entire process. If you have Kutools for Excel, its Convert Name to Reference Range utility will help you replace range names with cell references quickly and easily.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Please apply this utility by clicking Kutools > Name Tools > Convert Name to Reference Range

2. A dialog box is displayed, click Range tab and then select the range you want to replace with cell references from the Base Range. Then, click Replace button. See screenshot:

convert range names to cell references with kutools result

3. Another prompt box will be displayed to tell you the number of modified formulas and unchanged formulas, click OK, and then the range names in the selected rang have been replaced with cell references.


🔚 Conclusion

Whether you're dealing with a few formulas or an entire workbook, replacing named ranges with actual cell references is a great way to improve transparency, compatibility, and ease of collaboration.

  • For advanced users, VBA provides a flexible and programmable solution to automate the replacement process.
  • For everyone else, Kutools for Excel offers the fastest and most user-friendly way to complete the task in just a few clicks—no coding or formula editing required.

By choosing the method that best fits your workflow, you can efficiently clean up your formulas and ensure your spreadsheets remain easy to understand and maintain. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials to help you master Excel.


Relative Article:

Change cell reference in formulas to range names in Excel

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in