emukiss10

Board Regular
Joined
Nov 17, 2017
Messages
201
Hello!

Duplicates.

In Column F I have different numbers. The numbers are sorted ASC. I would like to have VBA script:

If a number occure in column F more than once, I want to put "DOUBLE" in column "V" in according row but only for second value and so on (first must not be marked. Colors are just for pointers - does not matter)

Range of my table is dynamic and lastRow should be determined by column F.

AFGHV
someName11dataPhone
someName22dataPhone
someName33dataPhone
someName33dataPhoneDOUBLE
someName44dataPhone
someName55dataPhone
someName66dataPhone
someName66dataPhoneDOUBLE
someName66dataPhoneDOUBLE

<tbody>
</tbody>

Please help me :)

Best Regards
W.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
How about
Code:
Sub AddDouble()

   Dim Cnt As Long
   
   For Cnt = Range("F" & Rows.Count).End(xlUp).Row To 3 Step -1
      If Range("F" & Cnt).Value = Range("F" & Cnt - 1).Value Then Range("V" & Cnt).Value = "DOUBLE"
   Next Cnt
End Sub
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,449
Members
449,083
Latest member
Ava19

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