Hi all,
I am very new to VBAs and macros and am not quite comfortable with them, but a new school project requires their use (I think!). I have looked at many other threads posing similar questions, but none of the solutions seem to fit my needs...
This is the deal: my project requires me to look at raw data and automatically have it sort into different files based on if there is is a duplicate entry in a specific column. This is an example of the raw data (dummy data and titles); assume that it is in a file called "raw data.xlsx":
[TABLE="width: 500"]
<tbody>[TR]
[TD]Order date [/TD]
[TD]Expected delivery[/TD]
[TD]Product[/TD]
[TD]Product code[/TD]
[TD]Price$[/TD]
[TD]Quantity[/TD]
[TD]Total[/TD]
[TD]Buyer ID[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<!--StartFragment--> <colgroup><col width="65" style="width:65pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 65, align: right"]14-09-01[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<!--StartFragment--> <colgroup><col width="65" style="width:65pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 65, align: right"]14-09-07[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]98476[/TD]
[TD]BETAx303[/TD]
[TD]1200[/TD]
[TD]12[/TD]
[TD]12400[/TD]
[TD][TABLE="width: 65"]
<!--StartFragment--> <colgroup><col width="65" style="width:65pt"> </colgroup><tbody>[TR]
[TD="width: 65"]123ZXY[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]14-09-04[/TD]
[TD]14-09-10[/TD]
[TD]34876[/TD]
[TD]ZETAq4[/TD]
[TD]1000[/TD]
[TD]14[/TD]
[TD]1400[/TD]
[TD]678TUV[/TD]
[/TR]
[TR]
[TD]14-09-04[/TD]
[TD]14-09-10[/TD]
[TD]34877[/TD]
[TD]WARK3[/TD]
[TD]875[/TD]
[TD]35[/TD]
[TD]30625[/TD]
[TD]678TUV[/TD]
[/TR]
[TR]
[TD]14-09-10[/TD]
[TD]14-09-15[/TD]
[TD]18983[/TD]
[TD]BETA304[/TD]
[TD]500[/TD]
[TD]47[/TD]
[TD]23500[/TD]
[TD]432LKN[/TD]
[/TR]
[TR]
[TD]14-09-19[/TD]
[TD]14-09-20[/TD]
[TD]58302[/TD]
[TD]NOVAs21[/TD]
[TD]1500[/TD]
[TD]15[/TD]
[TD]22500[/TD]
[TD]987EWW[/TD]
[/TR]
[TR]
[TD]14-09-19[/TD]
[TD]14-09-20[/TD]
[TD]58305[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR]
[TD]ZETAqa[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1000[/TD]
[TD]19[/TD]
[TD]19000[/TD]
[TD]987EWW[/TD]
[/TR]
[TR]
[TD]14-09-20[/TD]
[TD]14-09-28[/TD]
[TD]20394[/TD]
[TD]BLOMz1[/TD]
[TD]2000[/TD]
[TD]9[/TD]
[TD]18000[/TD]
[TD]567ABC[/TD]
[/TR]
[TR]
[TD]14-09-21[/TD]
[TD]14-10-01[/TD]
[TD]98477[/TD]
[TD][TABLE="width: 65"]
<colgroup><col width="65" style="width:65pt"></colgroup><tbody>[TR]
[TD="width: 65"][TABLE="width: 65"]
<tbody>[TR]
[TD]ZETAq4[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1000[/TD]
[TD]25[/TD]
[TD]25000[/TD]
[TD]302WLU[/TD]
[/TR]
</tbody>[/TABLE]
So what I need to do is to have a macro be able to identify if there are any duplicates in Column H/Buyer ID, and then have this row be cut and pasted (NOT simply copied and pasted) into another file, called "Multiple orders.xlsx". Essentially the point of the project is to be able to identify if any buyers are making more than one purchase per order.
I know how to do this manually, i.e.: find duplicates with conditional formatting and then cut/paste manually. However, I want to be able to automate this so that time is saved and the chance of errors is reduced.
Please let me know if something doesn't make sense… Any help would be much appreciated!
I am very new to VBAs and macros and am not quite comfortable with them, but a new school project requires their use (I think!). I have looked at many other threads posing similar questions, but none of the solutions seem to fit my needs...
This is the deal: my project requires me to look at raw data and automatically have it sort into different files based on if there is is a duplicate entry in a specific column. This is an example of the raw data (dummy data and titles); assume that it is in a file called "raw data.xlsx":
[TABLE="width: 500"]
<tbody>[TR]
[TD]Order date [/TD]
[TD]Expected delivery[/TD]
[TD]Product[/TD]
[TD]Product code[/TD]
[TD]Price$[/TD]
[TD]Quantity[/TD]
[TD]Total[/TD]
[TD]Buyer ID[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<!--StartFragment--> <colgroup><col width="65" style="width:65pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 65, align: right"]14-09-01[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<!--StartFragment--> <colgroup><col width="65" style="width:65pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 65, align: right"]14-09-07[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]98476[/TD]
[TD]BETAx303[/TD]
[TD]1200[/TD]
[TD]12[/TD]
[TD]12400[/TD]
[TD][TABLE="width: 65"]
<!--StartFragment--> <colgroup><col width="65" style="width:65pt"> </colgroup><tbody>[TR]
[TD="width: 65"]123ZXY[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]14-09-04[/TD]
[TD]14-09-10[/TD]
[TD]34876[/TD]
[TD]ZETAq4[/TD]
[TD]1000[/TD]
[TD]14[/TD]
[TD]1400[/TD]
[TD]678TUV[/TD]
[/TR]
[TR]
[TD]14-09-04[/TD]
[TD]14-09-10[/TD]
[TD]34877[/TD]
[TD]WARK3[/TD]
[TD]875[/TD]
[TD]35[/TD]
[TD]30625[/TD]
[TD]678TUV[/TD]
[/TR]
[TR]
[TD]14-09-10[/TD]
[TD]14-09-15[/TD]
[TD]18983[/TD]
[TD]BETA304[/TD]
[TD]500[/TD]
[TD]47[/TD]
[TD]23500[/TD]
[TD]432LKN[/TD]
[/TR]
[TR]
[TD]14-09-19[/TD]
[TD]14-09-20[/TD]
[TD]58302[/TD]
[TD]NOVAs21[/TD]
[TD]1500[/TD]
[TD]15[/TD]
[TD]22500[/TD]
[TD]987EWW[/TD]
[/TR]
[TR]
[TD]14-09-19[/TD]
[TD]14-09-20[/TD]
[TD]58305[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR]
[TD]ZETAqa[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1000[/TD]
[TD]19[/TD]
[TD]19000[/TD]
[TD]987EWW[/TD]
[/TR]
[TR]
[TD]14-09-20[/TD]
[TD]14-09-28[/TD]
[TD]20394[/TD]
[TD]BLOMz1[/TD]
[TD]2000[/TD]
[TD]9[/TD]
[TD]18000[/TD]
[TD]567ABC[/TD]
[/TR]
[TR]
[TD]14-09-21[/TD]
[TD]14-10-01[/TD]
[TD]98477[/TD]
[TD][TABLE="width: 65"]
<colgroup><col width="65" style="width:65pt"></colgroup><tbody>[TR]
[TD="width: 65"][TABLE="width: 65"]
<tbody>[TR]
[TD]ZETAq4[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1000[/TD]
[TD]25[/TD]
[TD]25000[/TD]
[TD]302WLU[/TD]
[/TR]
</tbody>[/TABLE]
So what I need to do is to have a macro be able to identify if there are any duplicates in Column H/Buyer ID, and then have this row be cut and pasted (NOT simply copied and pasted) into another file, called "Multiple orders.xlsx". Essentially the point of the project is to be able to identify if any buyers are making more than one purchase per order.
I know how to do this manually, i.e.: find duplicates with conditional formatting and then cut/paste manually. However, I want to be able to automate this so that time is saved and the chance of errors is reduced.
Please let me know if something doesn't make sense… Any help would be much appreciated!