跳到主要內容

如何在Excel中跟踪多個單元格區域的先例或從屬關係?

在Excel中,我們可以通過逐個單擊單元格來跟踪具有Excel中內置功能的單元格的先例或從屬關係。 但是,如果要同時跟踪數百個單元格,則如何在Excel中快速輕鬆地處理此任務?

使用輔助公式跟踪一系列單元的先例

使用VBA代碼的一系列單元格的跟踪相關項

使用Kutools for Excel跟踪一系列單元格的先例或從屬


要跟踪多個單元的先例,以下步驟可以為您提供幫助:

1。 輸入等號 = 放入一個空白單元格,然後單擊工作表的左上角以選擇整個工作表,請參見屏幕截圖:

doc追踪相關1

2。 然後按 Enter 鍵,然後會彈出警告消息,請參見屏幕截圖:

doc追踪相關2

3。 並點擊 OK 按鈕將其關閉,單元格中將顯示0,將其選中,然後單擊 公式 並點擊 追踪先例 兩次,一次跟踪了相應單元的所有先例,請參見屏幕截圖:

doc追踪相關3

4。 最後,您可以根據需要刪除幫助程序公式。


要跟踪多個單元格的依賴項,以下VBA代碼可以為您提供幫助,請執行以下操作:

1。 按住 ALT + F11 鍵打開 Microsoft Visual Basic for Applications 窗口。

2。 點擊 插入 > 模塊,然後將以下代碼粘貼到 模塊 窗口。

VBA代碼:一系列單元格的跟踪相關項:

Sub TraceDependents()
'updateby Extendoffice
    Dim xRg As Range
    Dim xCell As Range
    Dim xTxt As String
    On Error Resume Next
    xTxt = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the data range:", "Kutools for Excel", xTxt, , , , , 8)
    Set xRg = Application.Union(xRg, ActiveSheet.UsedRange)
    If xRg Is Nothing Then Exit Sub
    For Each xCell In xRg
        xCell.ShowDependents
    Next
End Sub

3。 然後按 F5 鍵來運行此代碼,然後會彈出一個提示框,提醒您選擇要使用的範圍,請參見屏幕截圖:

doc追踪相關4

4。 然後點擊 OK 按鈕,一次跟踪所有相關單元,請參見屏幕截圖:

doc追踪相關5


為了避免使用上述方法,在這裡,我將介紹一個方便的工具-Excel的Kutools,其 監視範圍的先例 監控器 家屬 範圍 實用程序,您可以快速輕鬆地解決此任務。

Excel的Kutools : 帶有300多個便捷的Excel加載項,可以在30天內免費試用

安裝後 Excel的Kutools,請執行以下操作:

1。 選擇要跟踪先例或從屬的數據范圍。

2。 然後點擊 庫工具 > 更多 > 監視範圍的先例/ 監視範圍的依存關係,請參見屏幕截圖:

3。 跟踪先前的單元格,選擇 監視範圍的先例 得到以下結果:

doc追踪相關7

跟踪相關單元格,請選擇 監視範圍的依存關係 得到以下結果:

doc追踪相關8

筆記:

1.此功能是動態的,將根據您的選擇進行更改。

2.您也可以通過單擊來應用此功能 Kutools 加 > 工作表設計,在 設計 標籤,點擊 監控器 先例和被撫養人。

3.您只需要再次單擊該實用程序即可禁用跟踪。

立即下載和免費試用Excel的Kutools!


Excel的Kutools:具有300多個方便的Excel加載項,可以在30天內免費試用,沒有任何限制。 立即下載並免費試用!

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
The reason that Excel hangs is due to the time. There is an error in the macro. It is showing application.union but what it should be doing is using application.intersect. The reason it's hanging is because it's working to trace dependents on the entire worksheet instead of the specified area.
This comment was minimized by the moderator on the site
Hi, jchumley,Yes, as you said, the code works for entire worksheet, if you need the code works for a selected range, please apply the below code:<div data-tag="code">Sub TraceDependents()
'updateby Extendoffice
Dim xRg As Range
Dim xCell As Range
Dim xTxt As String
On Error Resume Next
xTxt = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Please select the data range:", "Kutools for Excel", xTxt, , , , , 8)
If xRg Is Nothing Then Exit Sub
For Each xCell In xRg
xCell.ShowDependents
Next
End SubPlease try, hope it can help you!
This comment was minimized by the moderator on the site
I've found this macro very useful, thank you. I do have one rather large issue - the macro will cause excel to stop responding and I have to close out and restart the program each time I run it. Any fixes/recommendations? Thank you!
This comment was minimized by the moderator on the site
When running the macro version, it causes excel to stop responding. I then have to restart excel. Has anyone else encountered this and have a fix? This is a very helpful macro, thank you. Hoping I can resolve this issue.
This comment was minimized by the moderator on the site
Thank you very much!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations