By vba code :
How do I get the sum of cells within a selected range by pressing on the macro button , so that the result in cell A1 for example.
By vba code :
How do I get the sum of cells within a selected range by pressing on the macro button , so that the result in cell A1 for example.
Why bother, you can see it in the statusbar, bottom right.
____________________________________________
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
xld is right it will serve you no purpose!, but, [VBA]Range("A1").Value = Application.WorksheetFunction.Sum(Selection)[/VBA]
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
Simon Lloyd ,
thanks alot
Because I need the result to be in the active cell changed the code to the following:
[vba]
ActiveCell.value= Application.WorksheetFunction.Sum(Selection)
[/vba]
the underlined was the part that i can't make it .
so, again thank you very much.