Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2016, 11:55 AM
Mxthomp Mxthomp is offline Syntax error on formula that works in spreadsheet Windows 7 32bit Syntax error on formula that works in spreadsheet Office 2013
Novice
Syntax error on formula that works in spreadsheet
 
Join Date: Oct 2016
Posts: 1
Mxthomp is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 11-02-2016, 06:49 PM
macropod's Avatar
macropod macropod is offline Syntax error on formula that works in spreadsheet Windows 7 64bit Syntax error on formula that works in spreadsheet Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try using ActiveSheet.Range("al10").Value
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error on formula that works in spreadsheet 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 error on formula that works in spreadsheet Syntax to use OFFSET() in a cell formula? dlowrey Excel 3 07-09-2013 09:15 AM
Syntax error on formula that works in spreadsheet Why it works but the macro is error in VB? tinfanide Excel Programming 5 12-03-2011 12:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft