Autosum Lines with Numeric Values

Arcesso

New Member
Joined
Sep 13, 2010
Messages
3
I am a beginner and am also stuck. I would like this code to check for a column that has a numeric value, go to the first blank cell in the column, and then auto-sum all of the populated lines above it into the blank line and then move down the column to the next populated cell, check for a numeric value, move to the next blank cell, auto-sum, and so on. The format of the column is like this: blank line blank line data data blank line (desired space for auto-sum from data above) blank line data data data data blank line (desired space for auto-sum from data above) blank line There are always 2 blank cells but the data cells vary which is why I am having the trouble. Here is my code. The spot I cant get working is commented. Do If ActiveCell.Value <> "" Then If IsNumeric(ActiveCell) = True Then Begin = ActiveCell.Address Do Counter = Counter + 1 ActiveCell.Offset(1, 0).Select If ActiveCell.Offset(1, 0) = "" Then Finish = ActiveCell.Offset(-1, 0).Address End If Loop Until ActiveCell = "" 'broken code ActiveCell.Value = "=SUM(.cells(Begin),.cells(Finish))" 'broken code End If End If ActiveCell.Offset(0, 1).Select Loop Until ActiveCell.Offset(1, 0) = ""
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,216,116
Messages
6,128,933
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top