Compare and consolidating duplicated rows

G

Guest

Hi Dave,
My question is a little similar to Jen's:
Can you please help with this?
I am trying to write a macro whereby it searches for the same text as the
cell below it and makes one singular cell but adds the units & market values
in the cells next to them.
E.g - before macro
Stock, units, mkt val (these are the headings)
ABC (cell A1) 300 (cell B1) 1500 (cellC1)
ABC (cell A2) 400 (cell B2) 2000 (cellC2)
after macro
ABC (cell A1) 700 (cell B1) 3500 (cellC1)
This needs to be performed for many different stocks over the worksheet. S/s
is sorted by col A.
Thanks
George
 
D

Dave Peterson

Sometimes it's better to use what's built into excel.

You may want to look at Data|Subtotals or data|pivottable to get a nice summary.
 
G

Guest

I have a similar question. SO far this has been a great thread, but I was
wondering if there is a way to save the changed data.

What I have is this:

name / type / province/ country / lat / long / elev / pop /

belks / city / berg / afg / 36.25 / 72.45/ 1400 / 2300
belds/ city / berg / afg / 36.25 / 72.45/ 1400 / 2300
bolds/ city / berg / afg / 36.25 / 72.45/ 1400 / 2300
bends/ city / berg / afg / 36.25 / 72.45/ 1400 / 2300

etc.

I would like to keep the different spellings but put that into one row in
excel. so that i had something like:

belks / belds / bolds / bends / city / berg / afg / 36.25 /
72.45/ 1400 / 2300

Thanks in advance for the help.

Todd
 
T

Tony S.

Hi Otto,
Can you please re-post the macro you mentioned for George, or somethjing
similar? I need to consolidate duplicate text cells and add up their
combined quanties. (i.e.)

Before
A B
DESCRIPTION QTY
BAC3020 | BOLT 12
CBS2059 | WASHER 6
BAC3020 | BOLT 8
RIV1520 | RIVET 2
WAS6875 | WASHER 7
CBS2059 | WASHER 13
RIV1520 | RIVET 8

After
A B
DESCRIPTION QTY
BAC3020 | BOLT 20
CBS2059 | WASHER 19
RIV1520 | RIVET 10
WAS6875 | WASHER 7

Thanks,
Tony S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top