J
joeu2004
First, I am surprised the following alone does not work when there are
no dependents:
dim dep as Range
for each dep in cell.Dependents
[....]
next dep
Normally, the For statement works just fine when it has nothing to do.
But okay, the above produces an error when there are no dependents
("no cells were found").
So what do I test to prevent the error? I thought:
if cell.Dependents.Count > 0 then
for each dep in cell.Dependents
[...]
next dep
end if
But that does not work. I also tried IsNull() and IsEmpty(), to no
avail.
So, what's the correct magic incantation to use?
no dependents:
dim dep as Range
for each dep in cell.Dependents
[....]
next dep
Normally, the For statement works just fine when it has nothing to do.
But okay, the above produces an error when there are no dependents
("no cells were found").
So what do I test to prevent the error? I thought:
if cell.Dependents.Count > 0 then
for each dep in cell.Dependents
[...]
next dep
end if
But that does not work. I also tried IsNull() and IsEmpty(), to no
avail.
So, what's the correct magic incantation to use?