O
orenfarhi
I've finally got it :
Code
-------------------
Sub sumf()
'simulation of sum function
S = 0
x = ActiveCell.Row()
x = x - 1
For i = x To 6 Step -1
If Cells(x, 6) <> 0 Then
S = S + Cells(x, 6).Value
Else
S = S
End If
Next i
[sumall] = S
ActiveCell.FormulaR1C1 = "=SUM(sumall)"
End Sub
-------------------
but, if i change a value it doesn't change the sum automatically.
would have to run the code once again.
Any ideas???
thanks
Code
-------------------
Sub sumf()
'simulation of sum function
S = 0
x = ActiveCell.Row()
x = x - 1
For i = x To 6 Step -1
If Cells(x, 6) <> 0 Then
S = S + Cells(x, 6).Value
Else
S = S
End If
Next i
[sumall] = S
ActiveCell.FormulaR1C1 = "=SUM(sumall)"
End Sub
-------------------
but, if i change a value it doesn't change the sum automatically.
would have to run the code once again.
Any ideas???
thanks