what about formulas which use named ranges.
like
=MyRange +1
?
> what about formulas which use named ranges.
Maybe one could include something like this:
Dim nPrecedents As Long
On Error Resume Next 'In case there are none
nPrecedents = ActiveCell.Precedents.Count
If n > 0 Then
' There are cell references...
End If

Signature
HTH. :>)
Dana DeLouis
Windows XP, Office 2003
> what about formulas which use named ranges.
> like
[quoted text clipped - 21 lines]
>>>thanks in advance,
>>>-mark
Joerg - 26 May 2006 04:29 GMT
> > what about formulas which use named ranges.
>
[quoted text clipped - 9 lines]
>HTH. :>)
>Dana DeLouis
Maybe I missed something, but why not::
if ActiveCell.HasFormula then
'has formula with or without cell references (example for 'without
reference': =10+5)
else
'no formula
end if
Joerg
keepITcool - 26 May 2006 12:24 GMT
Dana,
precedents EXCLUDE references to cells other than activesheet.
[sheet1!a1].formula = "=sheet2!a1"
msgbox [sheet1!a1].precedents.count '<No CellsFound>
Testing .Formula <> .Value appears similar to .HasFormula
surprisingly it is 3x faster.

Signature
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
> > what about formulas which use named ranges.
>
[quoted text clipped - 7 lines]
> ' There are cell references...
> End If
Very good point.
> what about formulas which use named ranges.
> like
[quoted text clipped - 22 lines]
>>>thanks in advance,
>>>-mark