Thread: Macro How To
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Macro How To

try without r1c1. Notice double quotes

Range("J" & Rows.Count).End(xlUp).Offset(2).Formula = _
"=IF(A9=""Appliances"",0,IF(OR(H9=""No Charge"",H9=""Not
Avail"",H9=""""),0,H9*0.1))"

--
Don Guillett
SalesAid Software

"dread" wrote in message
...
I'm getting a run time error 1004 (application-defined or object-defined
error) on the following line of code:

Range("J" & Rows.Count).End(xlUp).Offset(2).FormulaR1C1 =
"=IF(R9C:R[-1]C[-9]='Appliances',0,IF(OR(R9C:R[-1]C[-2]='No
Charge',R9C:R[-1]C[-2]='Not
Avail',R9C:R[-1]C[-2]=''),0,R9C:R[-1]C[-2]*0.1))"

I'm not too familiar with coding IF statements using FormulaR1C1 syntax,
but
the IF statement in the spreadsheet that I'm trying to replace with the
macro
is:

=IF(A9="Appliances",0,IF(OR(H9="No Charge",H9="Not
Avail",H9=""),0,H9*0.1))