Property precedents not work for range passed to function

T

Tim Lund

Hi:

I have a range which normally have formulae in it, but
the user sometimes want to over write it with a number.
Unfortunately the user sometimes enters a value as a
formula, e.g. "=97.4+0.5". I want a function that will
tell me when a cell has a formula whether the formula
actually depends on any other cells. Why doesn't this
work?

Public Function hasnoprecedents(c As Range)

Dim r

On Error Resume Next
r= c.Precedents.Address
hasnoprecedents = Err.Number > 0

End Function
 

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