Thread: HasFormula
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default HasFormula

Select all your cells and do Edit=Goto=Special and select Formlas.

All you show would qualify as a formula.

from the immediate window:

? activeCell.HasFormula
True
? activeCell.Formula
=10
ActiveCell.Value = 10
? activeCell.HasFormula
False
?ActiveCell.Formula
10


Your second question is that none of the formula strings are valid range
references except =A30, so they would all return error except =A30.

From the immediate window:

?Range("=A30").Address
$A$30

--
Regards,
Tom Ogilvy

"John Wirt" wrote in message
...
Can someone say what kinds of formulas are detected as being present in a
cell by the HasFormula property?

Some different kinds of formulas:

=A30

=A30/K$29

=A20*A21

=atan(A20)

Also, can someone say what this statement will return and define as the
rngDst.

With ActiveCell
...
Set rngDst = Range(.Formula)
...
EndWith

depending upon which of the above formulas is in the ActiveCell?

Thank you.

John Wirt