Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default sum products...

Hi,

Is there another way without posting it in a total column
b/c the person whom i'm writting this VBA code for wants
the cost*number from the column for each column. And,
that cost*number should appear under each column.

For example:
Let's say I have this:

A B cost C D E F G H I J...
1 Pets cats 2.00 1 3 2 4 3 5 4 3...
2 Pets cats 3.00 3 4 2 5 7 3 2 3...
...
...total cost for all cats (please see below)
total for cats...
3 Pets dogs 2.00 2 2 3 4 34 23 23 23...
4 Pets dogs 1.00 4 5 13 4 34 23 23 23...
total for dogs..
...
...
total for Pets..
.....
.....
.....

**total cost for all cats:

... C D E F G H I J...
... $2 $6 $4 $8 $6 $10 $8 $6...
... $9 $12 $6 $15 $21 $9 $6 $9...
(then sum that up in another row:)
... $11 $18 $10 $23 $27 $19 $14 $15


Please use the subtotals for from data menu.
what I have is this:

*num is a variable for where the column of the array
should start..

Dim varr()
Dim rng As Range, i As Long
Set rng = Range("IV1").End(xlToLeft)
ReDim varr(1 To rng.Column - num)

For i = 1 To rng.Column - num
varr(i) = i + num
Next
ActiveCell.Range("A3").Select
Selection.subtotal GroupBy:=groups, Function:=xlSum, _
TotalList:=varr, Replace:=False, PageBreaks:=False, _
SummaryBelowData:=True

Other questions: Can I write the above subtotal function
in a different format? and Can I disable the grand total
summary from the subtotal function
If you could help me with that, that would be wonderful.

Thank you.
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
sum of similar products dcs68 Excel Discussion (Misc queries) 1 May 24th 07 03:08 PM
add numbers with corresponding products jenn Excel Worksheet Functions 2 March 2nd 07 03:21 PM
deleting products cj21 Excel Discussion (Misc queries) 3 February 3rd 06 10:03 PM
Products Gene Excel Worksheet Functions 1 April 21st 05 12:06 AM
Sum of products LC[_3_] Excel Programming 0 July 26th 03 03:10 AM


All times are GMT +1. The time now is 09:05 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"