I'm trying to write the following nested formulas into cell CY6 using VBA:
=IF(AND(CV6>MAX(BJ40,BJ5), CV6/MAX(BJ40,BJ5)>1.199999)," Moment Resistance Mr > Factored Moment Mf =" & ROUND(MAX(BJ40,BJ5),2) & ". Mr/Mf =" & ROUND(CV6/MAX(BJ40,BJ5),2) & ". Proceed to Crack Control Step =>", " Moment Ratio Mr/Mf is Smaller than 1.2, Increase Steel Area. Mr/Mf=" & ROUND(CV6/BJ40,2))
The code I tried to use is simple
Range("CY6").value = " =IF(AND(CV6>MAX(BJ40,BJ5), CV6/MAX(BJ40,BJ5)>1.199999)," Moment Resistance Mr > Factored Moment Mf =" & ROUND(MAX(BJ40,BJ5),2) & ". Mr/Mf =" & ROUND(CV6/MAX(BJ40,BJ5),2) & ". Proceed to Crack Control Step =>", " Moment Ratio Mr/Mf is Smaller than 1.2, Increase Steel Area. Mr/Mf=" & ROUND(CV6/BJ40,2)) "
I also tried the same thing using
worksheets("sheet1").range("CY6").formula= "...."
However, it returns a "compile error expected: end of statement" and highlights the word moment (the first one) I think it's because of the quotation marks but I am not sure how it is supposed to work.
Range("CY6").formulato assign a formula, not.value