View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] lcazarre@gmail.com is offline
external usenet poster
 
Posts: 1
Default Count Dependents

I want my Sub to count the number of cells that depend from the range
that is currently selected. I wrote the following code, but it does not
work. How can I set a range to be equal to the current selection?

Sub Test_Dependents()

Dim r As Range

Set r = ThisWorkbook.ActiveSheet.Selection
MsgBox (r.Dependents.Count)

End Sub

Thank you

Caezar