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 of products

Hi,

Let's say I have this:

A B cost C D E F G H I J...
1 Pets cats 19.00 1 23 2 4 23 45 43 23...
2 Pets cats 13.00 3 4 2 5 67 23 23 23...
...
...
total for cats...
3 Pets dogs 20.00 2 2 3 4 34 23 23 23...
4 Pets dogs 21.00 4 5 13 4 34 23 23 23...
total for dogs..
...
...
total for Pets..
.....
.....
.....
The dots mean so on and so forth.
Can I some how take the C column value and multipe by its
respective cost for all the cats and then the same for D,
E columns, etc? Then have a total of the cost for all
the pets?

What I have is this: since I dont have a stable amount of
columns for pets...

*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


I would like to have a subtotal for the cost as well.

Thank you so much.

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 Products with VLOOKUP TWJOHN Excel Worksheet Functions 3 January 3rd 10 06:02 AM
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


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