跳至主要内容

如何在 Excel 中找到某个特定名称区域的使用位置?

Author: Kelly Last Modified: 2025-07-31

创建一个名称区域后,您可能在许多单元格和公式中使用了该名称区域。但是,如何在当前工作簿中找出这些单元格和公式呢?本文介绍了三种巧妙的方法来轻松解决这个问题。

使用“查找和替换”功能查找某个特定名称区域的使用位置

使用 VBA 查找某个特定名称区域的使用位置

使用 Kutools for Excel 查找某个特定名称区域的使用位置


arrow blue right bubble 使用“查找和替换”功能查找某个特定名称区域的使用位置

我们可以轻松应用 Excel 的“查找和替换”功能来找出所有应用了特定名称区域的单元格。请按照以下步骤操作:

1. 同时按下 Ctrl + F 键以打开“查找和替换”对话框。

注意:您也可以通过点击“开始”>“查找和选择”>“查找”来打开此“查找和替换”对话框。

2. 在打开的“查找和替换”对话框中,请按照以下截图所示进行操作:

set options in the Find and Replace dialog box

(1) 在“查找内容”框中输入特定名称区域的名称;

(2) 从“范围”下拉列表中选择“工作簿”;

(3) 点击“查找全部”按钮。

注意:如果“范围”下拉列表不可见,请点击“选项 ”按钮以展开搜索选项。

现在,您将看到所有包含指定名称区域名称的单元格都列在“查找和替换”对话框的底部。请参见截图:

all cells containing the name of specified named range are listing

注意:“查找和替换”方法不仅可以找出所有使用该特定名称区域的单元格,还可以找出所有覆盖该名称区域的单元格。



arrow blue right bubble 使用 VBA 查找某个特定名称区域的使用位置

此方法将介绍一个 VBA 宏,用于找出所有使用该特定名称区域的单元格。请按照以下步骤操作:

1. 同时按下 Alt + F11 键以打开 Microsoft Visual Basic for Applications 窗口。

2. 点击“ 插入”>“模块”,并将以下代码复制并粘贴到打开的“模块”窗口中。

VBA:查找某个特定名称区域的使用位置

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. 点击 运行 按钮或按 F5 键运行此 VBA。

4. 现在,在第一个打开的 Kutools for Excel 对话框中,请输入工作表名称并点击“确定”按钮;然后在第二个打开的对话框中,请输入特定名称区域的名称,并点击“确定”按钮。请参见截图:

type the worksheet name
type the named range

5. 现在,第三个 Kutools for Excel 对话框弹出,并列出使用该特定名称区域的单元格,如下截图所示。

a dialog box comes out and lists cells using the certain named range

点击“确定”按钮关闭此对话框后,这些找到的单元格会立即在指定的工作表中被选中。

注意:此 VBA 每次只能在一个工作表中查找使用该特定名称区域的单元格。


arrow blue right bubble使用 Kutools for Excel 查找某个特定名称区域的使用位置

如果您已安装 Kutools for Excel,其“替换区域名称”工具可以帮助您查找并列出所有使用该特定名称区域的单元格和公式。

Kutools for Excel - 包含超过 300 个 Excel 必备工具。永久免费享受 AI 功能!立即下载!

1. 点击“Kutools”>“更多”>“替换区域名称 ”以打开“替换区域名称”对话框。

click Replace Range Names of kutools

2. 在打开的“替换区域名称”对话框中,转到“名称”选项卡,并点击“基于名称” 下拉列表,从中选择特定名称区域,如下截图所示:

select the certain named range from the eplace Range Names dialog box

现在,所有使用该特定名称区域的单元格及其对应的公式都会立即列在对话框中。

3. 关闭“替换区域名称”对话框。

Kutools for Excel - 通过超过300个必备工具,让Excel功能大幅提升。永久免费享受AI功能!立即获取


演示:在 Excel 中查找某个特定名称区域的使用位置

 

最佳 Office 办公效率工具

🤖 Kutools AI 助手:基于智能执行,彻底革新数据分析 生成代码创建自定义公式分析数据并生成图表调用 Kutools Functions
热门功能:查找、选中项的背景色或标记重复项|删除空行|合并列或单元格且不丢失数据|四舍五入(无公式)...
高级 LOOKUP多条件查找 (VLookup)多值查找 (VLookup)多表查找 (VLookup Across Multiple Sheets)模糊查找 (Fuzzy Lookup)...
高级下拉列表快速创建下拉列表依赖型下拉列表多选下拉列表...
列管理器添加指定数量的列移动列切换隐藏列的可见状态比较区域及列...
特色功能网格聚焦设计视图增强编辑栏工作簿 & 工作表管理器资源库(自动文本)|日期提取合并数据加密/解密单元格按列表发送电子邮件超级筛选特殊筛选(筛选粗体/倾斜/删除线等)...
热门15 大工具集12 款文本工具添加文本删除特定字符等)50+ 种图表 类型甘特图等)40+ 实用公式基于生日计算年龄等)19 款插入工具插入二维码按路径插入图片等)12 种转换工具小写金额转大写汇率转换等)7 款合并与分割工具高级合并行分割单元格等)...更多精彩等你发现
使用 Kutools,支持您的首选语言——包括英语、西班牙语、德语、法语、中文及40 多种其他语言!

用 Kutools for Excel 加速你的 Excel 技能,体验前所未有的高效办公。 Kutools for Excel 提供300 多项高级功能,助您提升效率,节省大量时间。点击此处,获取你最需要的功能...


Office Tab 为 Office 带来标签式界面,让你的工作更加轻松

  • 在 Word、Excel、PowerPoint 启用标签式编辑和阅读
  • 在同一窗口的新标签中打开和创建多个文档,无需新建窗口。
  • 办公效率提升50%,每天帮你减少上百次鼠标点击!