Maybe:
if i.hasformula then
would be safer.
(pretty interesting thread, too.)
Nils M wrote:
In addition to my last response where I rashly said that it works there
seems to be a bug in Excel:
The code:
v = Application.Evaluate(i.Formula)
produce a run time error for i.Formula="1"! All other values/formulas
are accepted even "=2-1". Strange but this is Excel ;-)
My code now looks like
If Left(i.Formula, 1) = "=" Then
v = Application.Evaluate(i.Formula)
Else
v = i.Value
End If
regards,
Nils
------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/
--
Dave Peterson