Search: | |||||

| ||||

Home » Forum » MS Office | RSS Feeds |

I wish to enter a formula into a cell using VB.

The formula is:-

ActiveCell.Formula = "=If(MoDNonComp="No",0,1)"

When I run the code I get a "1004: Application-defined or Object-

defined error".

I think the problem is the inverted commas of the "No" part of the

formula.

How do I get around this problem ?

the way i handle that is double quotes... or try using ' instead of double

Double the inverted commas.

ActiveCell.Formula = "=If(MoDNonComp=""No"",0,1)"

Didn't find what you were looking for?
Find more on Formula with conditional text
Or get search suggestion and latest updates.

Related Topics:

- formatting text which is in text formula
- clearing cells value without deleting the formula I've made in cell from excel formula , HOW?
- formula help but not vba please
- combining formula
- How to add several conditions for formula "SUMIF"
- chart conditional formatting
- Excel 2000 Conditional formatting
- Loop in formula
- Copy down formula with vba
- Array Formula
- Ctrl+Shift+Arrow Fails To Select Cells When Used in Formula Bar
- Excel VBA - need to copy paste conditional statement
- Conditional hyperlink
- Stuck on copying formula from 1 sheet to another
- Named formula/Windows dialog boxes
- Conditional Formatting
- Conditional Summing
- cells containing formula that refer to user-defined VBA function
- formula returns to multiple cells, without Array object?
- Need of an Excel Formula
- Formula to match,lookup and then retun alternate value
- Please Help me in this Formula
- Constructing Address formulas
- 2003 - Moving to a formula address
- Conditional format