Formula in VBA

rsrasc

New Member
Joined
Mar 28, 2011
Messages
11
A1= $100
B1=$50

Formula in C1 =

=IF(A1>=B1,"YES","NO")

I would like to know how the formula can be formulated in a VBA module.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try:
Code:
Range("C1").Formula = "=IF(A1>B1,""Yes"",""No"")"
 
Upvote 0
A1= $100
B1=$50

Formula in C1 =

=IF(A1>=B1,"YES","NO")

I would like to know how the formula can be formulated in a VBA module.


another way is type your formula into a cell, then use the macro record, select the cell with the formula with F2 and then press enter. Stop the macro recorder
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top