Assuming that your title row is always in Row 1. Select the cell that you want the total in and run the following macro:
Sub SumUp()
Dim Total As Long
For i = 2 To ActiveCell.Row - 1
Total = Cells(i, ActiveCell.Column).Value + Total
Next i
ActiveCell.Value = Total
End Sub
HTH. - Dan
Dan,
Tried to add the code you suggested but, i get a "type mismatch error" in the line:
Total = Cells(i, ActiveCell.Column).Value + Total
Any ideas?
If you like, i'll post the rest of the macro as it stands (its not vey long at the moment...), if you think that might be it!
Thanks,
Dave
:assuming that your title row is always in Row 1. Select the cell that you want the total in and run the following macro:
The reason is that there is text in one or more of the cells in that column, so it can't add it. Replace that line with:
If IsNumeric(Cells(i, ActiveCell.Column).Value) Then Total = Cells(i, ActiveCell.Column).Value + Total
That should take care of the problem.
Thanks a lot, that worked a treat! :)
Dave The reason is that there is text in one or more of the cells in that column, so it can't add it. Replace that line with: If IsNumeric(Cells(i, ActiveCell.Column).Value) Then Total = Cells(i, ActiveCell.Column).Value + Total That should take care of the problem.