Thread: Sub Sum
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Buddy Buddy is offline
external usenet poster
 
Posts: 21
Default Sub Sum


Remarkable. Thank you very much for your help Sir. I am very thankful for
your direction. It works very well.

"Joel" wrote:

Sub Sum()


LastRow = Range("A" & Rows.Count).End(xlUp).Row
LastColumn = Cells(1, Columns.Count).End(xlToLeft).Column

Range("A" & (LastRow + 2)) = "Total"
Range("B" & (LastRow + 2)).Formula = _
"=SUM(B2:B" & LastRow & ")"

Range("B" & (LastRow + 2)).Copy _
Destination:=Range(Range("B" & (LastRow + 2)), Cells((LastRow + 2),
LastColumn))


End Sub




"Buddy" wrote:

Sub Sum()
Range("Rows(2)" & Range("B:AA" & Rows.Count).End(xlUp).Row).Formula =
"=SUM(B3:B15)"
End Sub

Here is my current macro. I am aiming to get every Column in Row 2 starting
in B2 and ending in AA2 to put the formulas below inside. If you can help I
would appreciate it.

In B3 I am want to put this formula =SUM(B3:B15)
In C3 I am want to put this formula =SUM(C3:C15)
In D3 I am want to put this formula =SUM(D3:D15)
Continued...
In AA3 I am want to put this formula =SUM(AA3:AA15)