Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to sum subtotal with blank line

Dear all,

I have excel data as follows:


NO Pieces
--------- ----------
A001 10 pc
[blank line]
A001 20 pc
[blank line]
A001 30 pc
[blank line]
A002 15 pc
[blank line]
A002 15 pc


Now I want to write a VBA to sum a subtotal for the
column
of A001 and A002, the outcomes
should as follows:


NO Pieces Subtotal
--------- ---------- ------------
A001 10 pc
[blank line]
A001 20 pc
[blank line]
A001 30 pc 60pc
[blank line]
A002 15 pc
[blank line]
A002 15 pc 30pc


How can I do that in Excel with VBA or other method ?


Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default How to sum subtotal with blank line

If the subtotal does not have to be offset from the last occurence as
displayed, you could use a simple sumif for each "NO".
=Sumif(A3:A24,"A001",B3:B25) This assumes Pieces are in B3 to B25 and
"NO" starts at A3 to A25. Data in column B must be values.


hon123456 wrote:
Dear all,

I have excel data as follows:


NO Pieces
--------- ----------
A001 10 pc
[blank line]
A001 20 pc
[blank line]
A001 30 pc
[blank line]
A002 15 pc
[blank line]
A002 15 pc


Now I want to write a VBA to sum a subtotal for the
column
of A001 and A002, the outcomes
should as follows:


NO Pieces Subtotal
--------- ---------- ------------
A001 10 pc
[blank line]
A001 20 pc
[blank line]
A001 30 pc 60pc
[blank line]
A002 15 pc
[blank line]
A002 15 pc 30pc


How can I do that in Excel with VBA or other method ?


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
Copy Cell From Subtotal Line To Detail Line Tickfarmer Excel Discussion (Misc queries) 2 November 5th 09 02:40 PM
ON SUBTOTAL LINE CARRY FORWARD DENOMINATOR FROM PREVIOUS LINE Pam M Excel Worksheet Functions 1 January 22nd 09 07:15 AM
How do you add a blank line automatically after the Subtotal line MVSD Guy Excel Worksheet Functions 0 April 20th 06 01:04 AM
Subtotal line selection Jenny Excel Discussion (Misc queries) 1 April 13th 05 02:21 PM


All times are GMT +1. The time now is 04:37 AM.

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"