View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JulieD JulieD is offline
external usenet poster
 
Posts: 618
Default subtotalling using vba

Hi all

i have a worksheet in the following structure that i need to automatically
insert a row at the change of each category & sub total the lines above
(can't use the data / subtotal function nor pivot tables) ?

A B C D
E
1 Desc Value1 Value2
Value3
2 Item 1 <<blank <<blank <<blank
<<blank
3 Desc 11 10.00 15.00
4 Desc 12
10.00 20.00
5 Desc 13 5.00
6 Item 2 <<blank <<blank <<blank
<<blank
7 Desc 21
10.00
8 Desc 22
10.00 50.00


etc for 500 lines - all of the categories are different lengths, the only
thing that differentiates them is the title in column A with the rest of the
row being blank.

so in the above example i need to insert a row above row 6 and sum from
C3:C5, D3:D5, E3:E5 and then insert a row at row 10 and sum from C8:C9,
D8:D9, E8:E9

any ideas?

Cheers
JulieD