Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtotal To Include Item Description On Subtotal Line Tickfarmer Excel Discussion (Misc queries) 2 February 23rd 10 07:56 PM
sort macro, subtotal and add lines after subtotal David Excel Discussion (Misc queries) 1 August 29th 09 10:56 AM
subtotal label KJ2 Excel Discussion (Misc queries) 1 April 25th 08 03:30 PM
How do I Subtotal, then Sort by Subtotal Amounts? dnamertz Excel Discussion (Misc queries) 3 October 29th 06 12:17 AM
pasting to subtotal lines without replacing hidden -non-subtotal l harleydiva67 Excel Discussion (Misc queries) 1 October 12th 06 06:02 PM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"