parscon
11-11-2017, 05:59 AM
Hello i have this VBA code but it will sum in and put the value in the latest blank cell i need sum and paste the value in top blank cell like the the attached images
Sub SumAreas()
Dim Area As Range
For Each Area In Range("G1", Range("G" & Rows.Count).End(xlUp)).SpecialCells(xlCellTypeConstants).Areas
With Area
Cells(.Row + .Rows.Count, 7).Value = Evaluate("=Sum(G" & .Row & ":G" & .Row + .Rows.Count - 1 & ")")
Cells(.Row + .Rows.Count, 7).Font.Bold = True
End With
Next Area
End Sub
20924
Sub SumAreas()
Dim Area As Range
For Each Area In Range("G1", Range("G" & Rows.Count).End(xlUp)).SpecialCells(xlCellTypeConstants).Areas
With Area
Cells(.Row + .Rows.Count, 7).Value = Evaluate("=Sum(G" & .Row & ":G" & .Row + .Rows.Count - 1 & ")")
Cells(.Row + .Rows.Count, 7).Font.Bold = True
End With
Next Area
End Sub
20924