Sum using Macro?
Closed
Hipty
-
Jun 15, 2012 at 06:28 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Jun 16, 2012 at 11:27 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Jun 16, 2012 at 11:27 PM
Related:
- Sum using Macro?
- Spell number in excel without macro - Guide
- Macro excel download - Download - Spreadsheets
- Excel macro to create new sheet based on value in cells - Guide
- Sum sum disney - Download - Puzzle
- Run macro on opening workbook - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Jun 16, 2012 at 11:27 PM
Jun 16, 2012 at 11:27 PM
the sample data is like this
a 1
s 2
d 3
f 4
g 5
h 6
j 7
k 8
total 36
the total in col., B is total of all the data above this row
now try this macro
FIRST copy the sample data on a sheet and copy the macrpo in vb editor and run the macro and check
if it is ok study the macro and your sheet and modify the macro.
if inputbox is 3 then the total will be form B3 to B8.
a 1
s 2
d 3
f 4
g 5
h 6
j 7
k 8
total 36
the total in col., B is total of all the data above this row
now try this macro
Sub test() Dim x As Integer x = InputBox("Which row to sum from?") Cells(x, 2).End(xlDown) = WorksheetFunction.Sum(Range(Cells(x, 2), Cells(x, 2).End(xlDown).Offset(-1, 0))) End Sub
FIRST copy the sample data on a sheet and copy the macrpo in vb editor and run the macro and check
if it is ok study the macro and your sheet and modify the macro.
if inputbox is 3 then the total will be form B3 to B8.