Please help!
I'm stuck with this macro.
When I manually do a nested If statement with OR formula it works fine. But when I convert it to a macro, it errors out. What's frustrating is that this macro worked before with less OR formula statements. The revised one has a total of 30 OR formula statements.
The macro looks at internal codes' characters. If it meets the requirement (OR statement) IF formula will came back with "1" if false it come back "blank".
I'm stuck with this macro.
When I manually do a nested If statement with OR formula it works fine. But when I convert it to a macro, it errors out. What's frustrating is that this macro worked before with less OR formula statements. The revised one has a total of 30 OR formula statements.
The macro looks at internal codes' characters. If it meets the requirement (OR statement) IF formula will came back with "1" if false it come back "blank".
HTML:
Range("M2").Select
'ActiveCell.FormulaR1C1 = _
' "=IF(OR(LEFT(RC[-2],2)=""03"",LEFT(RC[-2],2)=""18"",LEFT(RC[-2],2)=""19"",LEFT(RC[-2],2)=""23"",LEFT(RC[-2],2)=""24"",LEFT(RC[-2],2)=""29"",LEFT(RC[-2],3)=""S03"",LEFT(RC[-2],3)=""S18"",LEFT(RC[-2],3)=""S19"",LEFT(RC[-2],3)=""S23"",LEFT(RC[-2],3)=""S24"",LEFT(RC[-2],3)=""S29"",LEFT(RC[-2],3)=""P03"",LEFT(RC[-2],3)=""P18"",LEFT(RC[-2],3)=""P19"",LEFT(RC[-2],3)=""P23""" & _
' "[-2],3)=""P24"",LEFT(RC[-2],3)=""P29"",LEFT(RC[-2],4)=""NB03"",LEFT(RC[-2],4)=""NB18"",LEFT(RC[-2],4)=""NB19"",LEFT(RC[-2],4)=""NB23"",LEFT(RC[-2],4)=""NB24"",LEFT(RC[-2],4)=""NB29"",LEFT(RC[-2],4)=""DC03"",LEFT(RC[-2],4)=""DC18"",LEFT(RC[-2],4)=""DC19"",LEFT(RC[-2],4)=""DC23"",LEFT(RC[-2],4)=""DC24"",LEFT(RC[-2],4)=""DC29"",LEFT(RC[-2],4)=""DP03"",LEFT(RC[-2],4)=""" & _
' "FT(RC[-2],4)=""DP19"",LEFT(RC[-2],4)=""DP23"",LEFT(RC[-2],4)=""DP24"",LEFT(RC[-2],4)=""DP29""),1,"""")"