?
Solved

Excel VBA Sum amount of identical rows and delete duplicate

Posted on 2014-11-06
5
Medium Priority
?
149 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

777 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