Hello, all
I am having some difficulty in a part of a macro where I want to insert this formula in an Excel spreadsheet.
=IF(TRIM(D12)="REG:",1,0)+IF(E12,1,0)
When executed, one of the problems I am having is that apostrophes are inserted around "E12", so the second IF looks like:
IF('E12',1,0)
and excel marks it with an error...
I bypassed the same error on the TRIM function by writing it like this:
TRIM("D12").
If I try the same method for the IF(E12,1,0) part, I get a syntax error.
This is the actual statement from the VB macro:
ActiveCell.FormulaR1C1 = "=IF(TRIM(""D" & detailrow & """)=""GEO:"",1,0)+IF(E" & detailrow & ",1,0)"
and this is the result:
=IF(TRIM("D12")="GEO:",1,0)+IF('E12',1,0)
Thanks in advance for any suggestions
Carlos