Need to Sum Columns within a Column!

FinancialAnalystKid

Well-known Member
Joined
Oct 14, 2004
Messages
779
I have about 30,000 rows of raw data.

There are rows of data per employee and then seperated by blank columns.

I need to total a column for each employee section.

I put in a TOTAL cell at the bottom of each employee section but summing each is tedious and will take forever!

I need a macro to go down column "K" find the word "TOTAL" and to the right of that cell (Column L) sum just that section.

So basically currently there is a cell labeled TOTAL on K15. on L15 I need it to sum(L2:L14)

The next TOTAL is on K27. on L27 I need it to sum(L17:L26)

...and so forth. Does this make sense?

Any help is MUCH appreciated.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
We're all volunteers. The tip jar is paid with a simple thanks. Cheers! :beerchug:
 
Upvote 0
Bit late, but I'll throw it in anyway.

Code:
Sub test()
    Dim lastrw As Long
        lastrw = Range("K" & Rows.Count).End(xlUp).Row
With ActiveSheet.Range("$K1:$K" & lastrw)
    .AutoFilter Field:=1, Criteria1:="Total"
        Range("$L2:$L" & lastrw).SpecialCells(xlCellTypeVisible).Select
    .AutoFilter
End With
    Application.SendKeys ("%=")
End Sub

Not used sendkeys before so it took me nearly an hour to figure out that it only works when you execute the code from excel, but not from the code editor :banghead:
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

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