Your message can encompass a lot of scenarios, so some detail about what you are working with would be useful to someone trying to help. Also, are you sure you need code to do this? Many native formula approaches can determine duplicate values in a range.
I have code names for places (i.e Adjal) but i want to check if there is ever 2 identical codes. And if there is an easier way I can use it, but i have used conditional formatting and i dont really like the way it presents the duplicates,
How do you want the duplicates to be dealt with? Do you want them deleted, or maybe do you want a list of only unique values but keep the original list untouched? And how would a list be presented - - in a message box or on a different worksheet? What do you want the identification or deletion result to be presented as?
Edit -- I need to step away for a few meetings, so if someone else can can jump in, so much the better. Otherwise I'll be back this afternoon.
If you have a list of values, and want to just check to see if there are any duplicates, one way is to use the COUNTIF formula, and count how many records are equal to the one on that row.
Any value greater than 1 indicates duplicates.
For example, if the data you are checking is in range G2:G100, and you want column H to say "Duplicate" if the value in column G is found more than once in the list, then you can use this formula in cell H2 (and copy all the way down to H100):
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.