Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort, Subtotal, Label Subtotal, Insert row
I have 4 columns. Need to do following:-
- sort by columns A, B, C in ascending order. - subtotal on change of column C - change subtotal text to "Subtotal for Sto XXX" where XXX is column C - insert a line after each subtotal for easy reading - insert grand total at end. I think this may sound easy for most of you. But I'm novice. Plse help. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort, Subtotal, Label Subtotal, Insert row
Hi
as a starting point I'd suggest you record a macro ('Tools - Macros - Record') and do this manually while recording this macro. After this have a look at the resulting code 8or post back with some questions). You may also take a look at http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Frank Kabel Frankfurt, Germany "Teak" schrieb im Newsbeitrag ... I have 4 columns. Need to do following:- - sort by columns A, B, C in ascending order. - subtotal on change of column C - change subtotal text to "Subtotal for Sto XXX" where XXX is column C - insert a line after each subtotal for easy reading - insert grand total at end. I think this may sound easy for most of you. But I'm novice. Plse help. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort, Subtotal, Label Subtotal, Insert row
Unfortunately, it's not that easy to work with
subtotals. But I can give you a few hints to get started. You can use the Excel subtotal funtion to get started. .Range("A2").Subtotal GroupBy:=iColCount, _ Function:=xlCount, TotalList:=Array(3), _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True Then you need to loop through all the rows to find subtotals iRowCount = ws.Range("A1").CurrentRegion.Rows.Count For i = 2 To iRowCount If Rows(i).OutlineLevel <= 2 Then ADD WHAT YOU NEED TO DO HERE Next i Diane -----Original Message----- I have 4 columns. Need to do following:- - sort by columns A, B, C in ascending order. - subtotal on change of column C - change subtotal text to "Subtotal for Sto XXX" where XXX is column C - insert a line after each subtotal for easy reading - insert grand total at end. I think this may sound easy for most of you. But I'm novice. Plse help. Thanks. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Subtotal To Include Item Description On Subtotal Line | Excel Discussion (Misc queries) | |||
sort macro, subtotal and add lines after subtotal | Excel Discussion (Misc queries) | |||
subtotal label | Excel Discussion (Misc queries) | |||
How do I Subtotal, then Sort by Subtotal Amounts? | Excel Discussion (Misc queries) | |||
pasting to subtotal lines without replacing hidden -non-subtotal l | Excel Discussion (Misc queries) |