Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
runtime error 1004 HELP PLS Marcelo P Excel Discussion (Misc queries) 2 May 23rd 07 08:56 PM
runtime error 1004 JC[_10_] Excel Programming 3 November 4th 05 12:50 PM
Another runtime 1004 error [email protected] Excel Discussion (Misc queries) 2 September 17th 05 09:21 AM
Runtime Error '1004' [email protected] Excel Discussion (Misc queries) 2 July 18th 05 06:10 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 12:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"