how to place formula to cell

  • Thread starter Thread starter Marek
  • Start date Start date
M

Marek

people, my task is to place to cells a formula

for example

for vv = 1 to 10
.cells(vv,2).formula = "=if(sum(XX:XX)>=160;2,3)"

next



when i try to assign a formula to a cell, i get the erorr,
why ??


can anybody help ????]

thank
 
Hi Marek,

Changing to:
cells(vv,2).formula = "=if(sum(XX:XX)>=160;2,3)"

to

cells(vv,2).formula = "=if(sum(XX:XX)>=160,2,3)"

worked for me.

I changed the semicolon after 160 to a comma.


---
Regards,
Norman



Marek said:
people, my task is to place to cells a formula

for example

for vv = 1 to 10
cells(vv,2).formula = "=if(sum(XX:XX)>=160;2,3)"

next



when i try to assign a formula to a cell, i get the erorr,
why ??


can anybody help ????]

thanks
 
Sub InsertFormula()
Dim vv As Integer
With Application
..ScreenUpdating = False
..Calculation = xlCalculationManual
For vv = 1 To 10
Cells(vv, 2).Formula = _
"=IF(SUM(C1:C10)>=160,2,3)"
Next
..ScreenUpdating = True
..Calculation = xlCalculationAutomatic
End With
End Sub
 
Not sure where that second dot came from. Should be "."
not ".." in the code.

Jason
-----Original Message-----
Sub InsertFormula()
Dim vv As Integer
With Application
..ScreenUpdating = False
..Calculation = xlCalculationManual
For vv = 1 To 10
Cells(vv, 2).Formula = _
"=IF(SUM(C1:C10)>=160,2,3)"
Next
..ScreenUpdating = True
..Calculation = xlCalculationAutomatic
End With
End Sub

---
HTH
Jason
Atlanta, GA
-----Original Message-----

people, my task is to place to cells a formula

for example

for vv = 1 to 10
.cells(vv,2).formula = "=if(sum(XX:XX)>=160;2,3)"

next



when i try to assign a formula to a cell, i get the erorr,
why ??


can anybody help ????]

thanks
-
---------------
Marek's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=13769
View this thread: http://www.excelforum.com/showthread.php?threadid=265164

.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top