Solved

Excel VBA Sum amount of identical rows and delete duplicate

Posted on 2014-11-06
5
134 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
  • 3
  • 2
5 Comments
 
LVL 31

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 5

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 5

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 31

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 5

Author Comment

by:Flora
ID: 40426611
Thank you Rob.

this is very helpful
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now