dynamic formula
Dim LastRecordNew2 As Long
LastRecordNew2 = 33
With ActiveSheet
.Range("AJ8:AJ" & LastRecordNew2).Formula _
= "=IF(ISERROR(BB8/BC8),""No Data"",BB8/BC8)"
End With
You have to use " for strings (not apostrophes) in your formulas. And in VBA,
you have to double them up to get one.
geebee wrote:
hi,
i have the following:
Range("AJ8:AJ" & lastrecordNew2).Select
Selection.Formula = "=IF(ISERROR(BB8/BC8),'No Data',BB8/BC8)"
but i have a problem with this because its not working right. i think it
has something to do with the syntax or something around the No Data.
how can i fix this?
thanks in advance,
geebee
--
Dave Peterson
|