Solved

Excel VBA Sum amount of identical rows and delete duplicate

Posted on 2014-11-06
5
146 Views
Last Modified: 2014-11-06
please see attached File.

I have two tables,  the current one and the result needed.

i need to VBA that when i run in on current it make it like the "result needed"

basically, i have a huge data that i want to get rid of the identical rows by summing thier Order total and then deleting them.

thank you.
EE.xlsx
0
Comment
Question by:Flora
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 33

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 40426394
Create a Pivot Table on the source data and have all columns populate into the pivot table with Order as a row header by which to sum. Choose option in Pivot Design tab ? Report layout > Repeat all Item labels.

Copy Pivot and Paste Values to break link to source data.

Re-arrange to put Order column back where required.

Delete Original Data.

Thanks
Rob H
0
 
LVL 6

Author Comment

by:Flora
ID: 40426437
Thank you Rob.

i need to do this everyday for a new set of data and pivot table can take alot of time.  would this be possible to be done programmatically using VBA?

thanks again
0
 
LVL 6

Author Comment

by:Flora
ID: 40426537
Dear Rob,

I think i am going to accept and use the solution you have provided.

i think this is the best way to do this.

thank you very much for your help.
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40426604
If you leave the pivot with links to the source data and copy/paste elsewhere each time, you can then just update source with new data, refresh pivot, copy elsewhere again.

The pivot data range can be dynamic for when the size of the data changes.

Thanks
Rob
0
 
LVL 6

Author Comment

by:Flora
ID: 40426611
Thank you Rob.

this is very helpful
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question