How to create unique item ID's from a list where items might be duplicate (or more)

mikesch236

New Member
Joined
Mar 5, 2015
Messages
4
Hi all,

I've googled and searched for 2 days now but am not finding the answers I am looking for ...

I am trying to build a customer history list for a small bike shop. With each sale, the customer's name, address, invoice number, items bought etc. get automatically added to a sheet in the workbook.
Given that there are return customers, I need to build a macro that will find the duplicates and assign a unique customer ID to each individual customer - I do not want to delete duplicates (I've found snippets on how to do that) but need to keep all as the items bought will typically be different

sample data:

Kd.EintragRe.Nr.DatumAdresse 1
115022920/02/2015Markus Vögl
215026424/02/2015Maria Beiwinkler-Stürzer
315028125/02/2015Franziska Schnell
415029426/02/2015Claudia Sahm
515031603/05/2015Mike Schroeder
615031503/05/2015Michaela Vollmer
715031703/05/2015Mike Schroeder
815031803/05/2015Mike Schroeder

<tbody>
</tbody>


Rows 1, 2, 3, 4 and 7 are unique and need to get a unique ID (eg. incrementally counting up from 1). Rows 6, 8 and 9 are the same customer so all 3 need to be assigned the same unique ID (ID's would be eg. in column E)

Any ideas on how to do this? I am fairly new at VBA programming so don't know what all is possible.

Thanks for any help!
Mike

PS: sorry, using Win 8.1 (but target is Win7) and Excel 2013
 
Last edited:

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
have you considered using a pivot table?

how do you know that you don't have 2 customers with the same name?
 
Upvote 0
sorry, error above .... obviously rows 1, 2, 3, 4 and 6 are unique, and 5, 7 and 8 are dupe's - I promise I'll learn to count soon ;)
 
Upvote 0
have you considered using a pivot table?

how do you know that you don't have 2 customers with the same name?

on the second question - there are more fields identifying the customer - street adress, town etc.

on #1 I've thought about a pivot, but given the sales customer list grows every day and will at some point (hopefully!) get very long, I'm not sure that's a viable solution long term

thanks!
 
Upvote 0
Here is a solution, but be aware that all excel solutions for your problem are only as good as the consistency of the data entry. If Mike Schroeder is ever entered as Michael Schroeder it will get a different number

Excel Workbook
ABCDE
1Kd.EintragRe.Nr.DatumAdresse 1
2115022920/02/2015Markus Vgl1
3215026424/02/2015Maria Beiwinkler-Strzer2
4315028125/02/2015Franziska Schnell3
5415029426/02/2015Claudia Sahm4
651503163/05/2015Mike Schroeder5
761503153/05/2015Michaela Vollmer6
871503173/05/2015Mike Schroeder5
981503183/05/2015Mike Schroeder5
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top