ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formula via VB error (https://www.excelbanter.com/excel-programming/353607-formula-via-vbulletin-error.html)

MM_KAT

Formula via VB error
 
Hi,
I am trying update formulas in cells via script. The formula is assigned
correctly, but doesn't work. Instead of value there is #NAME? error tag. But
when I click on formula row in the sheet and pressing Enter - all become
working! It appear with all simple formulas like SUME. I am desperate...

For x = 1 To 5
Range("A" & x).Formula = "=IF(B" & x & "=0,C" & x & "*" & _
Sheets("A").Range("A10") & ",0)"
Next x

Thanks!

Jim Rech

Formula via VB error
 
The code you posted doesn't work? Or something else involving "SUME"? Your
code works for me as long as I have a value in Sheets("A").Range("A10").

--
Jim
"MM_KAT" wrote in message
...
| Hi,
| I am trying update formulas in cells via script. The formula is assigned
| correctly, but doesn't work. Instead of value there is #NAME? error tag.
But
| when I click on formula row in the sheet and pressing Enter - all become
| working! It appear with all simple formulas like SUME. I am desperate...
|
| For x = 1 To 5
| Range("A" & x).Formula = "=IF(B" & x & "=0,C" & x & "*" & _
| Sheets("A").Range("A10") & ",0)"
| Next x
|
| Thanks!



MM_KAT[_2_]

Formula via VB error
 
Yes, just try to run this simple example, I don't understand what is wrong!
Thanks.

For i = 1 To 10
Range("A" & i).Formula = "=SUME(B1:C1)"
Next i



Jim Rech pÃ*Å¡e:

The code you posted doesn't work? Or something else involving "SUME"? Your
code works for me as long as I have a value in Sheets("A").Range("A10").

--
Jim
"MM_KAT" wrote in message
...
| Hi,
| I am trying update formulas in cells via script. The formula is assigned
| correctly, but doesn't work. Instead of value there is #NAME? error tag.
But
| when I click on formula row in the sheet and pressing Enter - all become
| working! It appear with all simple formulas like SUME. I am desperate...
|
| For x = 1 To 5
| Range("A" & x).Formula = "=IF(B" & x & "=0,C" & x & "*" & _
| Sheets("A").Range("A10") & ",0)"
| Next x
|
| Thanks!




Jim Rech

Formula via VB error
 
Using SUM it works for me (I have English Excel). Does using .FormulaLocal
help?

--
Jim
"MM_KAT" wrote in message
...
| Yes, just try to run this simple example, I don't understand what is
wrong!
| Thanks.
|
| For i = 1 To 10
| Range("A" & i).Formula = "=SUME(B1:C1)"
| Next i
|
|
|
| Jim Rech píse:
|
| The code you posted doesn't work? Or something else involving "SUME"?
Your
| code works for me as long as I have a value in Sheets("A").Range("A10").
|
| --
| Jim
| "MM_KAT" wrote in message
| ...
| | Hi,
| | I am trying update formulas in cells via script. The formula is
assigned
| | correctly, but doesn't work. Instead of value there is #NAME? error
tag.
| But
| | when I click on formula row in the sheet and pressing Enter - all
become
| | working! It appear with all simple formulas like SUME. I am
desperate...
| |
| | For x = 1 To 5
| | Range("A" & x).Formula = "=IF(B" & x & "=0,C" & x & "*" & _
| | Sheets("A").Range("A10") & ",0)"
| | Next x
| |
| | Thanks!
|
|
|



MM_KAT[_2_]

Formula via VB error
 
OK, thanks Jim, now it seems to be working... What is the difference between
Formula and FormulaLocal?

Thanks once again!


Jim Rech pÃ*Å¡e:

Using SUM it works for me (I have English Excel). Does using .FormulaLocal
help?

--
Jim
"MM_KAT" wrote in message
...
| Yes, just try to run this simple example, I don't understand what is
wrong!
| Thanks.
|
| For i = 1 To 10
| Range("A" & i).Formula = "=SUME(B1:C1)"
| Next i
|
|
|
| Jim Rech pÃ*se:
|
| The code you posted doesn't work? Or something else involving "SUME"?
Your
| code works for me as long as I have a value in Sheets("A").Range("A10").
|
| --
| Jim
| "MM_KAT" wrote in message
| ...
| | Hi,
| | I am trying update formulas in cells via script. The formula is
assigned
| | correctly, but doesn't work. Instead of value there is #NAME? error
tag.
| But
| | when I click on formula row in the sheet and pressing Enter - all
become
| | working! It appear with all simple formulas like SUME. I am
desperate...
| |
| | For x = 1 To 5
| | Range("A" & x).Formula = "=IF(B" & x & "=0,C" & x & "*" & _
| | Sheets("A").Range("A10") & ",0)"
| | Next x
| |
| | Thanks!
|
|
|





All times are GMT +1. The time now is 01:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com