This code to sum the values in the column A
[VBA]
Cells(1, 2).Formula = "=SUM(A:A)"
[/VBA]
Waht is the code or function to minus the values
This code to sum the values in the column A
[VBA]
Cells(1, 2).Formula = "=SUM(A:A)"
[/VBA]
Waht is the code or function to minus the values
Tricky!
[vba]
Cells(1, 2).Formula = "=-SUM(A:A)"
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
The result of plus for this values 1,2,4 is 7
The result of minus for this values 1,2,4 is 1
but your code show this result -7 its' not as I want 1
You obviously went to a different school than me.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Any way thank you
How is the Sum function supposed to know which values are to be added (4) and which are to be subtracted (1,2)?Originally Posted by Nader