G
Guest
My user wants the subtotals in a specific order --- which is not
alphabetical. She has numbered the order the subtotals should appear. Any
other subtotal groups will follow the listed subtotal groups. Note: these
groups may or may not always exists in a report.
1. Cash
2. Bonds
3. Common Stock
4. Common Funds
5. Other category
6. Other category......
'----------------------------------------------------------- Sort
' Range("A1:I1").Select
' ActiveCell.SpecialCells(xlLastCell).Select
' Range("A1").Select
' Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
' Selection.Sort Key1:=Range("A4"), Order1:=xlAscending,
Key2:=Range("C4") _
' , Order2:=xlAscending, Key3:=Range("B4"), Order3:=xlAscending,
Header:= _
' xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
' DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
' xlSortNormal
''----------------------------------------------------------- SubTotal
' Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3, 4,
5, 6, 7, _
' 8, 9), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
' Range("A1:I1").Select
' ActiveWorkbook.Save
alphabetical. She has numbered the order the subtotals should appear. Any
other subtotal groups will follow the listed subtotal groups. Note: these
groups may or may not always exists in a report.
1. Cash
2. Bonds
3. Common Stock
4. Common Funds
5. Other category
6. Other category......
'----------------------------------------------------------- Sort
' Range("A1:I1").Select
' ActiveCell.SpecialCells(xlLastCell).Select
' Range("A1").Select
' Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
' Selection.Sort Key1:=Range("A4"), Order1:=xlAscending,
Key2:=Range("C4") _
' , Order2:=xlAscending, Key3:=Range("B4"), Order3:=xlAscending,
Header:= _
' xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
' DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
' xlSortNormal
''----------------------------------------------------------- SubTotal
' Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3, 4,
5, 6, 7, _
' 8, 9), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
' Range("A1:I1").Select
' ActiveWorkbook.Save