Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Error Code 1004 when exporting from VB app to Excel 2007 sue mac Excel Discussion (Misc queries) 0 September 11th 07 08:10 AM
excel chart export error runtime 1004 Mau Charts and Charting in Excel 3 August 17th 05 11:35 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Excel 1004 Error When Pasting Special W/ Macro setoFairfax Excel Discussion (Misc queries) 2 April 27th 05 02:28 PM
Run-time error '1004' running to excel objects at once Dianna Braden Excel Programming 0 October 16th 03 08:55 PM


All times are GMT +1. The time now is 04:15 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"