Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Sum on Dynamic Data Range - Macro

Why not use either subtotals or a pivot table - both can be made dynamic

--
Cheers
Nigel



wrote in message
oups.com...
I am writing a VBA macro and have come across something I cannot figure
out. I have a spreadsheet and in column B is the product ID field.
There are 3 different product ID's and each of the products in column A
are given an ID based on a VLookup. At each change in the product ID
in column B, the macro adds a row to the spreadsheet and names that row
based on the product ID. Column C has the amount of sales for each
product category....and I want to have a total of all sales by product
ID in the new row that is added. Here is an example

Writing Tools (Prod ID) Sales
Pens 1.00
Pencils 2.00
Highliters 3.00
6.00 (This is where I need a
dynamic Sum!)
Paper (Prod ID)
Notebooks
Loose Leaf
Printer
(Another Dynamic Sum is needed
here....)
Misc (Prod ID)
Paper Clips
Tacks
Etc.........

The problem I am having is each time this file is saved the number of
products for each of the 3 product ID's may or may not change. How can
I tell Excel to only add the specific # of cells for that specific
category each time the macro is run?? Hope this makes some sort of
sense! Any help is MUCH appreciated!!

-Chris



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
Dynamic Range Name Macro Jonathan Cooper Excel Discussion (Misc queries) 3 March 24th 08 09:04 PM
Dynamic range for autofill macro Jim G Excel Discussion (Misc queries) 2 April 23rd 07 05:46 AM
How do I create a dynamic range in a macro Mark2122 Excel Worksheet Functions 2 February 2nd 07 09:44 PM
Macro to print a dynamic range Russ Excel Programming 3 January 13th 05 05:31 PM
Dynamic range in graphing macro Colin Macleod Excel Programming 2 November 1st 03 06:26 AM


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"