information function - does cell contain reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a formula that returns TRUE if the reference cell contains a
reference to any other cell and FALSE if the reference cell is a number or
text.

ISREF doesn't seem to work.
 
One way:

Public Function HasPrecedents(rRng As Range) As Variant
Dim rTest As Range
If rRng.Count > 1 Then
HasPrecedents = CVErr(xlErrRef)
Else
On Error Resume Next
Set rTest = rRng.Precedents
On Error GoTo 0
HasPrecedents = Not rTest Is Nothing
End If
End Function


If you're not familiar with UDFs, see:


http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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

Back
Top