MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Macro for adding columns up to the blank field


Posted by Jank on January 04, 2002 6:07 AM

I've got a spreadsheet that is extracting data from another source. The data is a list of items in our inventory. Each item has similar items that we consider to be the same item but the data is seperated into different rows. Example:
PRODUCT QTY
Van Ice Cream Bry 20
Van Ice Cream BR 10
Van Ice Cream PBR 30

Cht Ice Cream Bry 5
Cht Ice Cream BR 20

Now, remember this info is imported from another source. The space between the items is automatic and desired. It is updated weekly. We want to create a macro or something that we can click on the toolbar and it will add a third column that will be a Total.

Example:
PRODUCT QTY Total
Van Ice Cream Bry 20 60
Van Ice Cream BR 10
Van Ice Cream PBR 30

Cht Ice Cream Bry 5 25
Cht Ice Cream BR 20

I know this is probably simple but I'm racking my brain trying to get this to work. If we decide to start carring a new type of Van(illa) ice cream it screws everything all up. So, any suggestions. Thanks for all the help.


Posted by jank on January 04, 2002 6:10 AM

Here's the examples so you can read them

I've got a spreadsheet that is extracting data from another source. The data is a list of items in our inventory. Each item has similar items that we consider to be the same item but the data is seperated into different rows. Example:

Posted by Scott on January 04, 2002 6:38 AM

A couple of questions....

Just a couple of questions:
Is the product name in a seperate cell as the qty? Also, are the letters after the name in a seperate cell? What I'm looking for would be cells that contain the exact same thing. Then you could do a sumif formula.

Posted by Jank on January 06, 2002 11:32 PM

Re: A couple of questions....

Yes, the product name "ie. Van Ice Cream Bry" is in a cell all by itself. The "Bry" is part of the name and is included in the cell with the product name. Any ideas?