Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error 1004 HELP PLS | Excel Discussion (Misc queries) | |||
runtime error 1004 | Excel Programming | |||
Another runtime 1004 error | Excel Discussion (Misc queries) | |||
Runtime Error '1004' | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |