这表达了我想做的事,但显然不起作用。我想我想要做的是明确的:
获取一个单元格,获取其依赖项计数,并输出所有这些。
提前感谢任何输入
Sub Extract()
Dim i As Integer
For i = 1 To Workbooks("myBook.xls").Worksheets(1).Cells(14, 5).Dependents.Count
Debug.Print (Workbooks("myBook.xls").Worksheets(1).Cells(14, 5).Dependents(i))
Next i
End Sub
答案 0 :(得分:3)
你可以做到
Sub Extract()
Dim i As Range
With Workbooks("Book1.xls").Worksheets(1).Cells(14, 5)
For Each i In .Dependents
Debug.Print i.Value i.Address
Next i
End With
End Sub
HTH!
修改
.Dependents
是transitive closure os .DirectDependents
,我不确定你想要哪一个......试试这两个!