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?
- problem with conditional output in templates
- conditional redirect
- Conditional deletes and page updating
- VBA Formula prob
- Getting a formula to copy from inside VBA
- Macro help newbie: VB conditional if statement to copy paste cell
- Populate Formula(Function) in rows
- searching within formulas
- Conditional Formatting.
- Formula using range name in VBA code
- Three Leveled Formula
- R1C1 Formula
- Paste Formula help
- Conditional formatting?
- Conditional delete from List Box
- VBA or array formula?
- VBA code to add values in two cells which have formulas
- combining formula
- How to add several conditions for formula "SUMIF"
- chart conditional formatting
- formula help but not vba please
- Excel 2000 Conditional formatting
- Loop in formula