ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Runtime error 1004 (https://www.excelbanter.com/excel-programming/389508-runtime-error-1004-a.html)

JayDe

Runtime error 1004
 
I have a problem

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

But this is working: ws.Cells(3, 2).Formula = "SUMIF(B2:B7,B19,D2:D7)"


The only difference is the "=" sign.
Can anyone help me?


I have a Norvegian Excel installation , and the Norwegian syntax is:

ws.Cells(3, 2).Formula = "=SUMMERHVIS(B2:B7;B19;D2:D7)"

but it is not working


___________
Regards
JaydDe

Dave Peterson

Runtime error 1004
 
VBA is USA centric.

You'll want to use:
ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

This doesn't answer the question, but did you really mean to plop that formula
into B3?

I don't have a guess why you could plop the text but not the formula in that
cell.



JayDe wrote:

I have a problem

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

But this is working: ws.Cells(3, 2).Formula = "SUMIF(B2:B7,B19,D2:D7)"

The only difference is the "=" sign.
Can anyone help me?

I have a Norvegian Excel installation , and the Norwegian syntax is:

ws.Cells(3, 2).Formula = "=SUMMERHVIS(B2:B7;B19;D2:D7)"

but it is not working


___________
Regards
JaydDe


--

Dave Peterson

joel

Runtime error 1004
 
I ran the following code and it worked perfectly.

Sub writecell()
Set ws = ActiveSheet
ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"
End Sub

"Dave Peterson" wrote:

VBA is USA centric.

You'll want to use:
ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

This doesn't answer the question, but did you really mean to plop that formula
into B3?

I don't have a guess why you could plop the text but not the formula in that
cell.



JayDe wrote:

I have a problem

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

But this is working: ws.Cells(3, 2).Formula = "SUMIF(B2:B7,B19,D2:D7)"

The only difference is the "=" sign.
Can anyone help me?

I have a Norvegian Excel installation , and the Norwegian syntax is:

ws.Cells(3, 2).Formula = "=SUMMERHVIS(B2:B7;B19;D2:D7)"

but it is not working


___________
Regards
JaydDe


--

Dave Peterson


JayDe

Runtime error 1004
 
Thank you guys

When I change to English syntax in VBA it turn up in Norwegian in the
worksheet

The sentence: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

Turns up as: =SUMMERHVIS(B2:B7;B19;D2:D7) in cell B3

Dave:
This only a simplified example of what I am about to do. I do not need this
in B3

--
___________
Regards
JaydDe


JayDe skrev:

I have a problem

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

But this is working: ws.Cells(3, 2).Formula = "SUMIF(B2:B7,B19,D2:D7)"


The only difference is the "=" sign.
Can anyone help me?


I have a Norvegian Excel installation , and the Norwegian syntax is:

ws.Cells(3, 2).Formula = "=SUMMERHVIS(B2:B7;B19;D2:D7)"

but it is not working


___________
Regards
JaydDe


Dave Peterson

Runtime error 1004
 
So does this mean you found the reason why you got the 1004 error?



JayDe wrote:

Thank you guys

When I change to English syntax in VBA it turn up in Norwegian in the
worksheet

The sentence: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

Turns up as: =SUMMERHVIS(B2:B7;B19;D2:D7) in cell B3

Dave:
This only a simplified example of what I am about to do. I do not need this
in B3

--
___________
Regards
JaydDe

JayDe skrev:

I have a problem

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

But this is working: ws.Cells(3, 2).Formula = "SUMIF(B2:B7,B19,D2:D7)"


The only difference is the "=" sign.
Can anyone help me?


I have a Norvegian Excel installation , and the Norwegian syntax is:

ws.Cells(3, 2).Formula = "=SUMMERHVIS(B2:B7;B19;D2:D7)"

but it is not working


___________
Regards
JaydDe


--

Dave Peterson

JayDe

Runtime error 1004
 
Yes

The reason was because I in VBA wrote =SUMMERHVIS (Norwegian) instead of
=SUMIF (English) and I also had to put , (comma) between the arguments
instead of ; (semicolon)
--
___________
Regards
JaydDe


Dave Peterson skrev:

So does this mean you found the reason why you got the 1004 error?



JayDe wrote:

Thank you guys

When I change to English syntax in VBA it turn up in Norwegian in the
worksheet

The sentence: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

Turns up as: =SUMMERHVIS(B2:B7;B19;D2:D7) in cell B3

Dave:
This only a simplified example of what I am about to do. I do not need this
in B3

--
___________
Regards
JaydDe

JayDe skrev:

I have a problem

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

But this is working: ws.Cells(3, 2).Formula = "SUMIF(B2:B7,B19,D2:D7)"


The only difference is the "=" sign.
Can anyone help me?


I have a Norvegian Excel installation , and the Norwegian syntax is:

ws.Cells(3, 2).Formula = "=SUMMERHVIS(B2:B7;B19;D2:D7)"

but it is not working


___________
Regards
JaydDe


--

Dave Peterson


Dave Peterson

Runtime error 1004
 
Ahhh. Then your original post wasn't really what you tried <bg.

You showed commas in the line that you said didn't work.

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"


JayDe wrote:

Yes

The reason was because I in VBA wrote =SUMMERHVIS (Norwegian) instead of
=SUMIF (English) and I also had to put , (comma) between the arguments
instead of ; (semicolon)
--
___________
Regards
JaydDe

Dave Peterson skrev:

So does this mean you found the reason why you got the 1004 error?



JayDe wrote:

Thank you guys

When I change to English syntax in VBA it turn up in Norwegian in the
worksheet

The sentence: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

Turns up as: =SUMMERHVIS(B2:B7;B19;D2:D7) in cell B3

Dave:
This only a simplified example of what I am about to do. I do not need this
in B3

--
___________
Regards
JaydDe

JayDe skrev:

I have a problem

This is not working: ws.Cells(3, 2).Formula = "=SUMIF(B2:B7,B19,D2:D7)"

But this is working: ws.Cells(3, 2).Formula = "SUMIF(B2:B7,B19,D2:D7)"


The only difference is the "=" sign.
Can anyone help me?


I have a Norvegian Excel installation , and the Norwegian syntax is:

ws.Cells(3, 2).Formula = "=SUMMERHVIS(B2:B7;B19;D2:D7)"

but it is not working


___________
Regards
JaydDe


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 01:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com