Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Formula - Error 1004 - Bug? Mistake?
Hello,
I have a worksheet and the following line of code: Me.Range("G11").Formula = "=SUMIF(A1;1;A3:A6)" Excel says: 1004 Application error What am I doing wrong? If I enter the exact same string as a formula, everything works fine. Help! :) Markus |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Formula - Error 1004 - Bug? Mistake?
Either change the semi colons (;) to commas or use FormulaLocal rather than
Formula (assuming your list separator is set to semicolon). However, I don't thing the formula will produce what you want. Maybe you want an if statement =If(A1=1,Sum(A3:A6),0) -- Regards, Tom Ogilvy "Markus Wilthaner" wrote in message m... Hello, I have a worksheet and the following line of code: Me.Range("G11").Formula = "=SUMIF(A1;1;A3:A6)" Excel says: 1004 Application error What am I doing wrong? If I enter the exact same string as a formula, everything works fine. Help! :) Markus |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Formula - Error 1004 - Bug? Mistake?
"Tom Ogilvy" wrote:
Either change the semi colons (;) to commas or use FormulaLocal rather than Formula (assuming your list separator is set to semicolon). First, thanks for helping me out. You were right, the semi colons are my list separator. Excel is smart and replaces commas in the from-code-formulas with the semicolons. I tried the same script on my Excel 2003 computer and it filled in the formulas. However, all I get is an "Name" Error. When I edit the cell (F2) and press enter without changing anything, it works! Odd.... Using "LocalFormula" causes my Excel 2003 to give me that 1004 Application error. :( What I was trying to accomplish is to count the occurence of a giving string in a number of cells, using SUMIF(<Range, <GivenString). Thank you, Markus |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Formula - Error 1004 - Bug? Mistake?
Using "LocalFormula"
it isn't localformula, it is formulalocal when you use formulalocal, the formula should be written as you would enter it in a cell (including non-english works/names if that is how you work in your spreadsheet). -- Regards, Tom Ogilvy Markus Wilthaner wrote in message m... "Tom Ogilvy" wrote: Either change the semi colons (;) to commas or use FormulaLocal rather than Formula (assuming your list separator is set to semicolon). First, thanks for helping me out. You were right, the semi colons are my list separator. Excel is smart and replaces commas in the from-code-formulas with the semicolons. I tried the same script on my Excel 2003 computer and it filled in the formulas. However, all I get is an "Name" Error. When I edit the cell (F2) and press enter without changing anything, it works! Odd.... Using "LocalFormula" causes my Excel 2003 to give me that 1004 Application error. :( What I was trying to accomplish is to count the occurence of a giving string in a number of cells, using SUMIF(<Range, <GivenString). Thank you, Markus |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error Code 1004 when exporting from VB app to Excel 2007 | Excel Discussion (Misc queries) | |||
excel chart export error runtime 1004 | Charts and Charting in Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Excel 1004 Error When Pasting Special W/ Macro | Excel Discussion (Misc queries) | |||
Run-time error '1004' running to excel objects at once | Excel Programming |