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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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