Hmm, no it apparently won't. I thought I might try and code a general
solution by iterating the worksheets, then iterating the cells in
SpecialCells(xlCellTypeFormulas)
on each sheet, using InStr to check each formula for the address of the cell
in the selection. But then I realized I actually had to do 4 checks (one for
each absolute/relative setting for the row and column) and these along with
the selected cell's worksheet name concatenated in front with a "!"
concatenated between them; however, I also realized I had to account for
those cases where the worksheet name needed to be surrounded by apostrophes.
I figured this would be a lot of work, but doable... and I almost started to
code this all up when I realized I would also have to account for named
constants for the cells and/or worksheets. It was at this point I decide it
would be far too much work to do it this way.
Rick
"TomPl" wrote in message
...
Just noticed your post. Will this pick up dependencies on other
worksheets?
Tom
"Rick Rothstein (MVP - VB)" wrote:
What "non-dependent" cells do you want to highlight... to the ends of the
worksheet? I doubt that; so, for the code below, I am going to assume you
have selected the range of cells that you are interested in determining
whether there are dependents or not. Another question... in what way did
you
want to "highlight" the cells not having dependents... color the
interior,
select them, something else? For the code below, I'll assume you want to
select them. That means to use the code below, you will need to select
the
cells you are interested in, run the macro (press Alt+F8, select the
macro,
run it) and you will get a new selection consisting of only those cell
with
no dependents.
Sub SelectNonDependentCells()
Dim C As Range
Dim R As Range
Dim NonDependents As Range
On Error Resume Next
For Each C In Selection
Set R = C.Dependents
If Err.Number 0 Then
If NonDependents Is Nothing Then
Set NonDependents = C
Else
Set NonDependents = Union(C, NonDependents)
End If
End If
Err.Clear
Next
NonDependents.Select
End Sub
Rick
"rajesh" wrote in message
...
Hi
I would like to highlight cells that are not having any dependents
(i.e.,
any other cell in the same worksheet or another worksheet does not
depend
on
the cell to be validated).
any possible solution through vba / macro is of great help.
thanks in advance