Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum values in a column

Status
Not open for further replies.

Bilberry

Programmer
Dec 17, 2007
111
NL
Hi,
Im working in column E. In VBA i endup in an active cell, and i want to sum the values above the active cell. How can i arrange that? Let say column E contains the values, and on the position x i want to put the SUM:

10
2
3
4
5
x

So x should be: 24.

I can have a lot of values and i only want to do the SUM of the values ABOVE the active cell, till an empty value. Is that possible?
 
i need to do something with: Range(ActiveCell, ActiveCell.End(xlUp)).Select How can i put the range into a SUM below the range?
 
After Googling a while, i think this should be the solution:

ActiveCell.Offset(-1, 0).Select
Countrows = Range(ActiveCell, ActiveCell.End(xlUp)).Count
ActiveCell.FormulaR1C1 = "=SUM(R[-" & Countrows & "]C:R[-1]C)"
Selection.Font.Bold = True
 
Hi,

So explain how this will function in practice.

Are you saying, for instance, that if the active cell was on the cell containing the 4, that 4 would be replaced by 15 in your example?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top