View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey[_184_] ExcelMonkey[_184_] is offline
external usenet poster
 
Posts: 1
Default Checking cell for Dependents


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

--
ExcelMonke
-----------------------------------------------------------------------
ExcelMonkey's Profile: http://www.excelforum.com/member.php...nfo&userid=522
View this thread: http://www.excelforum.com/showthread.php?threadid=27618