#1
|
|||
|
|||
Syntax error on formula that works in spreadsheet
Hello,
My formula works in my spreadsheet, calculates everything accurately, but when I add it to the macro, I get a Compile error: Syntax error. The formula reads: ActiveSheet.Range("al10").Formula = "=IF(AJ10="NOT ON POG","NOT ON POG",AK10)" All of my other formulas are working, but not this one. Is it because it cannot have words in the macro? The other formulas read: ActiveSheet.Range("aJ10").Formula = "=VLOOKUP(AI10,'[Authorized Items V2.xlsx]Data'!$A:$H,8,FALSE)" ActiveSheet.Range("ak10").Formula = "=IF(r10+u10+x10+Aa10+ad10+ag10<=0,0,r10+u10+x10+A a10+ad10+ag10)" Thank you for the help! Michelle Last edited by Mxthomp; 10-31-2016 at 12:30 PM. Reason: I left off the = before the IF statement. Still have teh syntax error though. |
#2
|
||||
|
||||
Try using ActiveSheet.Range("al10").Value
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formula works on most cells | gbaker | Excel | 1 | 04-26-2014 12:31 AM |
Error handling in formula - suppress 'Syntax Error' | Cosmo | Word | 7 | 02-24-2014 07:08 AM |
Using multiple formulas in one (IF, AND and SUM) gives syntax error | markdeniet | Word | 1 | 02-05-2014 05:17 AM |
Syntax to use OFFSET() in a cell formula? | dlowrey | Excel | 3 | 07-09-2013 09:15 AM |
Why it works but the macro is error in VB? | tinfanide | Excel Programming | 5 | 12-03-2011 12:53 AM |