I am new to VBA and want to add two values. The code I have is:
Cells(7 + i + 1, 6).Select
sum1 = "=SUMIFS('[" + strFil_1 + "]Tooling forecast template'!R6C20:R500C20,'[" + strFil_1 + "]Tooling forecast template'!R6C7:R500C7,""=ME1"", '[" + strFil_1 + "]Tooling forecast template'!R6C5:R500C5,""=Test Tool"", '[" + strFil_1 + "]Tooling forecast template'!R6C13:R500C13,""=" + ArrME1(i) + """, '[" + strFil_1 + "]Tooling forecast template'!R6C6:R500C6,""<>Actual tool/equipment change"", '[" + strFil_1 + "]Tooling forecast template'!R6C23:R500C23,""<>Cancelled"", '[" + strFil_1 + "]Tooling forecast template'!R6C23:R500C23,""<>Not Ordered"")"
sum2 = "=SUMIFS('[" + strFil_1 + "]Tooling forecast template'!R6C20:R500C20,'[" + strFil_1 + "]Tooling forecast template'!R6C7:R500C7,""=ME1"", '[" + strFil_1 + "]Tooling forecast template'!R6C5:R500C5,""=Hard Tool"", '[" + strFil_1 + "]Tooling forecast template'!R6C13:R500C13,""=" + ArrME1(i) + """, '[" + strFil_1 + "]Tooling forecast template'!R6C6:R500C6,""<>Actual tool/equipment change"", '[" + strFil_1 + "]Tooling forecast template'!R6C23:R500C23,""<>Cancelled"", '[" + strFil_1 + "]Tooling forecast template'!R6C23:R500C23,""<>Not Ordered"") "
ActiveCell.FormulaR1C1 = sum1 + sum2
The reason I have the sum is because if I have it as one expression then the row will be too large and VBA doesn't split it into two lines properly, if this is possible please post that as well.
The error I get with the above code is it just shows TRUE or FALSE and not the actually sum.