Runtime error 1004 when using .Formula

trodneyrotter

New Member
Joined
Jun 20, 2014
Messages
15
Hi - I'm trying to insert a formula using vba, which I thought would be fairly simple. The code I have used is:
Code:
Range("H573").Formula = "=IFERROR(IF(SUMIF(C_datadump!$B$23884:$B$24191,I_control!$F573,C_datadump!BG$23884:BG$24191)=1,1,0),"")"

However I am receiving runtime error 1004. I've been reading the existing forum posts about this and it seems the common problem is using ';' instead of ',' but I've not used semi-colon.

Another possible error maybe that its closing out too soon because of the "" at the end of the formula, but even when I remove these it still errors.

Grateful for any help you can give.

Thanks,

Ryan
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Whenever you use quotes in a formula in VBA they need to be doubled
Rich (BB code):
Range("H573").Formula = "=IFERROR(IF(SUMIF(C_datadump!$B$23884:$B$24191,I_control!$F573,C_datadump!BG$23884:BG$24191)=1,1,0),"""")"
 
Last edited:
Upvote 0
Try this.
Code:
Range("H573").Formula = "=IFERROR(IF(SUMIF(C_datadump!$B$23884:$B$24191,I_control!$F573,C_datadump!BG$23884:BG$24191)=1,1,0),"""")"
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,195
Members
449,072
Latest member
DW Draft

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