ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking cell for Dependents (https://www.excelbanter.com/excel-programming/316684-checking-cell-dependents.html)

ExcelMonkey[_184_]

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



All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com