FillDown Formula Run-Time error

brundag5

New Member
Joined
Jan 23, 2014
Messages
17
Hello,

I use the filldown feature in vba to enter formulas into my cell range. I'm trying to enter the following formula into my cell range but and getting an error. I don't see what the problem is. I'm hoping one of you can. Thanks in advance for your help.

Code:
Range("BS3") = "=IF(AND(BO3 > $BB$20;BO3 < $BB$21); BR3; "")": Range("BS3:BS" & LR).FillDown
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try
Code:
Range("BS3:BS" & lr).Formula = "=IF(AND(BO3 > $BB$20;BO3 < $BB$21); BR3; """")"
 
Upvote 0
Assuming that LR is a valid value, you do not have to use FillDown. If you use R1C1 formula reference, you can assign the formula to the whole range in one step:
Code:
    Range("BS3:BS" & LR).FormulaR1C1 = "=IF(AND(RC[-4] > R20C54;RC[-4] < R21C54); RC[-1]; """")"
The formula may look complicated, but the good news is, you don't need to figure it out.
Let Excel do the work for you. Just turn on the Macro Recorder, enter the formula into a cell manually, stop the Recorder, and view the code it created.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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