Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default macro-written correct formula returns #NAME? and #VALUE?

Hello. I'm having troubles writing an excel 2003 macro. I'm using a
line like
Worksheets("ctacte").Range("C" & c) = "=SUMA($C$" & s & ":$C

$" & (c - 1) & ")" <<
to write the formula =SUMA($C$11:$C$12) to a cell in the "ctacte"
worksheet. (SUMA instead of SUM because I'm using a spanish version of
excel).
Problem is, when the macro finishes running, the cell, instead of
returning the value of the sum I get a #NAME? error. The odd thing
here is that if I press F2 and then ENTER on the cell, I get the
correct result. The formula doesn't get autocorrected of anything, it
is exactly the same thing that the macro returns. Only that to get the
result I need to F2-ENTER it!

Any idea of what the problem would be? I'd really appreciate it!

Thanks and forgive my bad english!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default macro-written correct formula returns #NAME? and #VALUE?

check
Tools, Options, Calculations - is it set on automatic or manual?
sometimes in a macro automatic gets set to manual & then we forget to
change it back......... next time excel opens it will be on manual
without anything being done.
hth!
susan



On Apr 9, 11:43 am, "s.a." wrote:
Hello. I'm having troubles writing an excel 2003 macro. I'm using a
line like
Worksheets("ctacte").Range("C" & c) = "=SUMA($C$" & s & ":$C

$" & (c - 1) & ")" <<
to write the formula =SUMA($C$11:$C$12) to a cell in the "ctacte"
worksheet. (SUMA instead of SUM because I'm using a spanish version of
excel).
Problem is, when the macro finishes running, the cell, instead of
returning the value of the sum I get a #NAME? error. The odd thing
here is that if I press F2 and then ENTER on the cell, I get the
correct result. The formula doesn't get autocorrected of anything, it
is exactly the same thing that the macro returns. Only that to get the
result I need to F2-ENTER it!

Any idea of what the problem would be? I'd really appreciate it!

Thanks and forgive my bad english!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default macro-written correct formula returns #NAME? and #VALUE?

Hi S,

Try replacing the Spanish funtion SUMA with the
Englsh equivalent Sum.

Excel will automatically translater the function into the
user''s version language.


---
Regards,
Norman


"s.a." wrote in message
oups.com...
Hello. I'm having troubles writing an excel 2003 macro. I'm using a
line like
Worksheets("ctacte").Range("C" & c) = "=SUMA($C$" & s & ":$C

$" & (c - 1) & ")" <<
to write the formula =SUMA($C$11:$C$12) to a cell in the "ctacte"
worksheet. (SUMA instead of SUM because I'm using a spanish version of
excel).
Problem is, when the macro finishes running, the cell, instead of
returning the value of the sum I get a #NAME? error. The odd thing
here is that if I press F2 and then ENTER on the cell, I get the
correct result. The formula doesn't get autocorrected of anything, it
is exactly the same thing that the macro returns. Only that to get the
result I need to F2-ENTER it!

Any idea of what the problem would be? I'd really appreciate it!

Thanks and forgive my bad english!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default macro-written correct formula returns #NAME? and #VALUE?

Unbelievable, but it worked. I forgot to mention it earlier, but
pressing F9 ("Calculate now" or whatever it is called in english)
didn't do anything, and calculations were always set to Automatic.

Why would this happen?

On Apr 9, 1:05 pm, "Norman Jones"
wrote:
Hi S,

Try replacing the Spanish funtion SUMA with the
Englsh equivalent Sum.

Excel will automatically translater the function into the
user''s version language.

---
Regards,
Norman

"s.a." wrote in message

oups.com...

Hello. I'm having troubles writing an excel 2003 macro. I'm using a
line like
Worksheets("ctacte").Range("C" & c) = "=SUMA($C$" & s & ":$C

$" & (c - 1) & ")" <<
to write the formula =SUMA($C$11:$C$12) to a cell in the "ctacte"
worksheet. (SUMA instead of SUM because I'm using a spanish version of
excel).
Problem is, when the macro finishes running, the cell, instead of
returning the value of the sum I get a #NAME? error. The odd thing
here is that if I press F2 and then ENTER on the cell, I get the
correct result. The formula doesn't get autocorrected of anything, it
is exactly the same thing that the macro returns. Only that to get the
result I need to F2-ENTER it!


Any idea of what the problem would be? I'd really appreciate it!


Thanks and forgive my bad english!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default macro-written correct formula returns #NAME? and #VALUE?

VBA is USA centric.

"s.a." wrote:

Unbelievable, but it worked. I forgot to mention it earlier, but
pressing F9 ("Calculate now" or whatever it is called in english)
didn't do anything, and calculations were always set to Automatic.

Why would this happen?

On Apr 9, 1:05 pm, "Norman Jones"
wrote:
Hi S,

Try replacing the Spanish funtion SUMA with the
Englsh equivalent Sum.

Excel will automatically translater the function into the
user''s version language.

---
Regards,
Norman

"s.a." wrote in message

oups.com...

Hello. I'm having troubles writing an excel 2003 macro. I'm using a
line like
Worksheets("ctacte").Range("C" & c) = "=SUMA($C$" & s & ":$C
$" & (c - 1) & ")" <<
to write the formula =SUMA($C$11:$C$12) to a cell in the "ctacte"
worksheet. (SUMA instead of SUM because I'm using a spanish version of
excel).
Problem is, when the macro finishes running, the cell, instead of
returning the value of the sum I get a #NAME? error. The odd thing
here is that if I press F2 and then ENTER on the cell, I get the
correct result. The formula doesn't get autocorrected of anything, it
is exactly the same thing that the macro returns. Only that to get the
result I need to F2-ENTER it!


Any idea of what the problem would be? I'd really appreciate it!


Thanks and forgive my bad english!


--

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
MAX returns correct column, but row -1? Ryan[_2_] Excel Worksheet Functions 3 July 7th 07 01:22 AM
Excel to run Word macro & Word returns value to be written in spreadsheet KS[_2_] Excel Programming 0 November 28th 06 05:33 PM
Address block carriage returns not correct Bill Excel Worksheet Functions 3 October 4th 06 02:10 AM
Sum formula in macro returns zero DanSmoach Excel Programming 6 May 17th 06 09:11 AM
Excel returns @name? error when using a custom written function in Al Maher Excel Programming 2 April 13th 06 01:31 PM


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