Checking cell for Dependents

E

ExcelMonkey

Thaknks Robin. Quick question. If I wanted to count the number o
dependents the cell has, how would I incorporate this into your code?
I am assuming that I would use a Count Method on the rngDep. But sinc
the code is simply creating a boolean ouput (TRUE/FALSE) I am assumin
that a count will only be 1 or 0. Any ideas? Thnks


Public Function HasInternalDependents(rngTest As Range) As Boolean
Dim rngCell As Range
Dim rngDep As Range

For Each rngCell In rngTest
Set rngDep = Nothing
On Error Resume Next
Set rngDep = rngCell.Dependents
On Error GoTo 0
If Not rngDep Is Nothing Then
HasInternalDependents = True
Exit Function
End If
Next rngCell
End Functio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top