Hello all. I first must say...I am a VBA newbie so please bear with me, but would like some help maybe even modifying a macro. I also know that the macro recorder itself is not the right place for autosumming.
I work daily with a spreadsheet that's downloaded from my company web site that I have to manually sort and group, which is not the issue here, this unfortunately has to be manual, however I would like to be able to click on a certain cell in column M, press a macro shortcut and get an auto-sum for the continguous dataset above it plus a blank row for columns M, N, O, P, X & Z.
The number of rows will always be different and I will need to sum many groups on 1 page. I may have a group of 25 items (from row 2-26) and want my sum in the above listed columns on row 28, then another group from rows 30-37 and the sum in row 39, etc...I really hope this makes sense and thank you in advance for any much needed assistance..
Sample code from macro recorder of what I am trying to do:
Sub autosum()
ActiveCell.Range("A1:D1").Select
Selection.FormulaR1C1 = "=SUM(R[-15]C:R[-1]C)"
ActiveCell.Offset(0, 11).Range("A1:C1").Select
Selection.FormulaR1C1 = "=SUM(R[-15]C:R[-1]C)"
ActiveCell.Offset(5, -11).Range("A1:D1").Select
Selection.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)"
ActiveCell.Offset(0, 11).Range("A1:C1").Select
Selection.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)"
ActiveCell.Offset(4, -11).Range("A1:D1").Select
Selection.FormulaR1C1 = "=SUM(R[-2]C:R[-1]C)"
End Sub
I work daily with a spreadsheet that's downloaded from my company web site that I have to manually sort and group, which is not the issue here, this unfortunately has to be manual, however I would like to be able to click on a certain cell in column M, press a macro shortcut and get an auto-sum for the continguous dataset above it plus a blank row for columns M, N, O, P, X & Z.
The number of rows will always be different and I will need to sum many groups on 1 page. I may have a group of 25 items (from row 2-26) and want my sum in the above listed columns on row 28, then another group from rows 30-37 and the sum in row 39, etc...I really hope this makes sense and thank you in advance for any much needed assistance..
Sample code from macro recorder of what I am trying to do:
Sub autosum()
ActiveCell.Range("A1:D1").Select
Selection.FormulaR1C1 = "=SUM(R[-15]C:R[-1]C)"
ActiveCell.Offset(0, 11).Range("A1:C1").Select
Selection.FormulaR1C1 = "=SUM(R[-15]C:R[-1]C)"
ActiveCell.Offset(5, -11).Range("A1:D1").Select
Selection.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)"
ActiveCell.Offset(0, 11).Range("A1:C1").Select
Selection.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)"
ActiveCell.Offset(4, -11).Range("A1:D1").Select
Selection.FormulaR1C1 = "=SUM(R[-2]C:R[-1]C)"
End Sub