peter.perhach
New Member
- Joined
- Aug 1, 2011
- Messages
- 1
Can someone tell me what the syntax error is in this statement/ formula? The formula works fine in excel, but when I edit my macro and paste this formula, it won't compile.
ActiveCell.FormulaR1C1 = "=IF(N2<=29,"<30",IF(AND(N2>29,N2<61),"30-60",IF(AND(N2>=61,N2<=90),"61-90",IF(AND(N2>=91,N2<=180),">90",">180"))))"
And if you have a better way to write this nested IF statement, I'd like to know.
The use of this formula, is a cell has a number and I want the formula to respond with a comment " " , based on the range that the value falls into.
Thanks
ActiveCell.FormulaR1C1 = "=IF(N2<=29,"<30",IF(AND(N2>29,N2<61),"30-60",IF(AND(N2>=61,N2<=90),"61-90",IF(AND(N2>=91,N2<=180),">90",">180"))))"
And if you have a better way to write this nested IF statement, I'd like to know.
The use of this formula, is a cell has a number and I want the formula to respond with a comment " " , based on the range that the value falls into.
Thanks