Skip to main content

How to find where a certain named range is used in Excel?

After creating a named range, you may use this named range in many cells and formulas. But how to find out these cells and formulas in current workbook? This article introduces three tricky ways to solve it easily.

Find where a certain named range is used with Find and Replace feature

Find where a certain named range is used with VBA

Find where a certain named range is used with Kutools for Excel


arrow blue right bubble Find where a certain named range is used with Find and Replace feature

We can easily apply Excel’s Find and Replace feature to find out all cells applying the certain named range. Please do as follows:

1. Press the Ctrl + F keys simultaneously to open the Find and Replace dialog box.

Note: You can also open this Find and Replace dialog box with clicking the Home > Find & Select > Find.

2. In the opening Find and Replace dialog box, please do as following screenshot shown:

doc where named range used 1

 

(1) Type the name of certain named range into the Find what box;

(2) Select Workbook from the Within drop down list;

(3) Click the Find All button.

Note: If the Within drop down list is invisible, please click the Options button to expand the searching options.

Now you will see all cells containing the name of specified named range are listing at the bottom of Find and Replace dialog box. See screenshot:

doc where named range used 2

Note: The Find and Replace method not only finds out all cells using this certain named range, but also finds out all cells covering with this named range.


arrow blue right bubble Find where a certain named range is used with VBA

This method will introduce a VBA macro to find out all cells which use the certain named range in Excel. Please do as follows:

1. Press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.

2. Click the Insert > Module, and copy and paste following code into the opening Module window.

VBA: Find where a certain named range is used

Sub Find_namedrange_place()
Dim xRg As Range
Dim xCell As Range
Dim xSht As Worksheet
Dim xFoundAt As String
Dim xAddress As String
Dim xShName As String
Dim xSearchName As String
On Error Resume Next
xShName = Application.InputBox("Please type a sheet name you will find cells in:", "Kutools for Excel", Application.ActiveSheet.Name)
Set xSht = Application.Worksheets(xShName)
Set xRg = xSht.Cells.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0
If Not xRg Is Nothing Then
xSearchName = Application.InputBox("Please type the name of named range:", "Kutools for Excel")
Set xCell = xRg.Find(What:=xSearchName, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
        If Not xCell Is Nothing Then
xAddress = xCell.Address
If IsPresent(xCell.Formula, xSearchName) Then
xFoundAt = xCell.Address
End If
            Do
Set xCell = xRg.FindNext(xCell)
If Not xCell Is Nothing Then
If xCell.Address = xAddress Then Exit Do
If IsPresent(xCell.Formula, xSearchName) Then
If xFoundAt = "" Then
xFoundAt = xCell.Address
Else
xFoundAt = xFoundAt & ", " & xCell.Address
End If
End If
Else
Exit Do
End If
Loop
End If
If xFoundAt = "" Then
MsgBox "The Named Range was not found", , "Kutools for Excel"
Else
MsgBox "The Named Range has been found these locations: " & xFoundAt, , "Kutools for Excel"
End If
On Error Resume Next
xSht.Range(xFoundAt).Select
End If
End Sub
Private Function IsPresent(sFormula As String, sName As String) As Boolean
Dim xPos1 As Long
Dim xPos2 As Long
Dim xLen As Long
Dim I As Long
xLen = Len(sFormula)
xPos2 = 1
Do
xPos1 = InStr(xPos2, sFormula, sName) - 1
If xPos1 < 1 Then Exit Do
IsPresent = IsVaildChar(sFormula, xPos1)
xPos2 = xPos1 + Len(sName) + 1
If IsPresent Then
If xPos2 <= xLen Then
IsPresent = IsVaildChar(sFormula, xPos2)
End If
End If
Loop
End Function
Private Function IsVaildChar(sFormula As String, Pos As Long) As Boolean
Dim I As Long
IsVaildChar = True
For I = 65 To 90
If UCase(Mid(sFormula, Pos, 1)) = Chr(I) Then
IsVaildChar = False
Exit For
End If
Next I
If IsVaildChar = True Then
If UCase(Mid(sFormula, Pos, 1)) = Chr(34) Then
IsVaildChar = False
End If
End If
If IsVaildChar = True Then
If UCase(Mid(sFormula, Pos, 1)) = Chr(95) Then
IsVaildChar = False
End If
End If
End Function
3. Click the Run button or press F5 Key to run this VBA.

4. Now in the first opening Kutools for Excel dialog box please type the worksheet name into it and click the OK button; and then in the second opening dialog box please type the name of certain named range into it, and click the OK button. See screenshots:

5. Now the third Kutools for Excel dialog box comes out and lists cells using the certain named range as below screenshot shown.

After clicking the OK button to close this dialog box, these found cells are selected in the specified worksheet at once.

Note: This VBA can only look for cells using the certain named range in one worksheet at a time.


arrow blue right bubbleFind where a certain named range is used with Kutools for Excel

In you have Kutools for Excel installed, its Replace Range Names utility can help you find and list all cells and formulas which use the certain named range in Excel.

Kutools for Excel - Packed with over 300 essential tools for Excel. Enjoy a full-featured 30-day FREE trial with no credit card required! Download now!

1. Click the Kutools > More > Replace Range Names to open the Replace Range Names dialog box.

doc replace range names

2. In the opening Replace Range Names dialog box, go to Name tab, and click the Base Name drop down list and select the certain named range from it as below screenshot shown:

doc where named range used 4

Now all cells and corresponding formulas which use the certain named range are listing in the dialog box at once.

3. Close the Replace Range Names dialog box.

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy a full-featured 30-day FREE trial with no credit card required! Get It Now


Kutools for Excel: Over 300 handy tools at your fingertips! Start your 30-day free trial with no feature limitations today. Download Now!

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

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...

Description


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!
Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
In your VBA code, row 19 is in RED text before I even attempt to run it... I know there will be a problem. Once I run the code that line (#19) gives an error message:Compile error: syntax error
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations