#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default marco help


Keep getting an error message with i try to write a marco to caculate
the subtotal of a items. say i am trying to total the number of sales a
rep has for a product. please see example below and help.
ID Product Item Sales
p1 beh 1745 20
p1 hbe 1742 5
p1 bed 125 10
p1 hbe 172 15
p2 hbe 1742 52

and so on with several defferent ID and products.......any help you
could give would be helpful.


--
mr1104839
------------------------------------------------------------------------
mr1104839's Profile: http://www.excelforum.com/member.php...o&userid=37661
View this thread: http://www.excelforum.com/showthread...hreadid=572716

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default marco help

Did you turn on the macro recorder and do it manually?

Also, you would need to sort by ID and then Product before you do it to get
the correct subtotals.
--
Regards,
Tom Ogilvy


"mr1104839" wrote:


Keep getting an error message with i try to write a marco to caculate
the subtotal of a items. say i am trying to total the number of sales a
rep has for a product. please see example below and help.
ID Product Item Sales
p1 beh 1745 20
p1 hbe 1742 5
p1 bed 125 10
p1 hbe 172 15
p2 hbe 1742 52

and so on with several defferent ID and products.......any help you
could give would be helpful.


--
mr1104839
------------------------------------------------------------------------
mr1104839's Profile: http://www.excelforum.com/member.php...o&userid=37661
View this thread: http://www.excelforum.com/showthread...hreadid=572716


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default marco help

Are you trying to insert Subtotals (Data - Subtotal) or are you trying to
write a macro to look through your data and determine some subtotals? To
insert subtotals turn on the macro recorder and just have at it. To determine
the subtotals via code I mighrt suggest using a sumproduct formula instead...
Here is a link...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
--
HTH...

Jim Thomlinson


"mr1104839" wrote:


Keep getting an error message with i try to write a marco to caculate
the subtotal of a items. say i am trying to total the number of sales a
rep has for a product. please see example below and help.
ID Product Item Sales
p1 beh 1745 20
p1 hbe 1742 5
p1 bed 125 10
p1 hbe 172 15
p2 hbe 1742 52

and so on with several defferent ID and products.......any help you
could give would be helpful.


--
mr1104839
------------------------------------------------------------------------
mr1104839's Profile: http://www.excelforum.com/member.php...o&userid=37661
View this thread: http://www.excelforum.com/showthread...hreadid=572716


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
Marco Help looper Excel Discussion (Misc queries) 2 May 12th 07 06:55 PM
help me with this marco Gary Keramidas Excel Programming 1 April 22nd 06 02:01 AM
Can it be done by marco? kaon[_5_] Excel Programming 1 June 28th 04 10:56 AM
Marco to run every day at 12 bris Excel Programming 6 March 3rd 04 01:07 PM
marco David Kuehl Excel Programming 4 September 18th 03 11:37 PM


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