hi
thanks for that useful tip.
The code is very easy to modify to allow many columns to be compared.
Here is an example of columns B, C & D being compared. Just copy & paste this code into the Visual Basic Macro Editor in Excel.
Go to top toolbar menu (at the top of the screen) & select Tools > Macro > Visual Basic Editor
A new window will open.
Select View > Code from the toolbar menu (at the top of the screen).
Just paste the code from below.
You may need to adapt it slightly to customise it to compare your desired columns. If this is the case, simply replace the column letters with your own in the code (e.g This example shows the columns B, C & D being compared).
In the same Visual Basic Window > Save the macro.
You can easily make a button to execute this code whenever you paste a new ip entry into the spreadsheet.
Right-Click on the top toolbar in your spreadsheet > select Customise.
A small window opens choose the tab "Commands" and scroll down until you find "Macro". You should see a yellow smiley face icon - select it and drag it to your top toolbar.
Click the button in the same window "Modify Selection" > click assign macro and select your recently saved macro.
Close the window, save and press the new button - your duplicate entries will be highlighted.
Paste the following code into the visual basic code editor.
Sub HighlightDups()
Dim i, LastRowB, LastRowC, LastRowD
LastRowB = Range("B" & Rows.Count).End(xlUp).Row
LastRowC = Range("C" & Rows.Count).End(xlUp).Row
LastRowD = Range("D" & Rows.Count).End(xlUp).Row
Columns("B:B").Interior.ColorIndex = xlNone
Columns("C:C").Interior.ColorIndex = xlNone
Columns("D:D").Interior.ColorIndex = xlNone
For i = 1 To LastRowB
If Application.CountIf(Range("C:C"), Cells(i, "B")) > 0 Then
Cells(i, "B").Interior.ColorIndex = 36
If Application.CountIf(Range("D:D"), Cells(i, "B")) > 0 Then
Cells(i, "B").Interior.ColorIndex = 36
End If
End If
Next
For i = 1 To LastRowC
If Application.CountIf(Range("B:B"), Cells(i, "C")) > 0 Then
Cells(i, "C").Interior.ColorIndex = 36
If Application.CountIf(Range("D:D"), Cells(i, "C")) > 0 Then
Cells(i, "C").Interior.ColorIndex = 36
End If
End If
Next
For i = 1 To LastRowD
If Application.CountIf(Range("B:B"), Cells(i, "D")) > 0 Then
Cells(i, "D").Interior.ColorIndex = 36
If Application.CountIf(Range("C:C"), Cells(i, "D")) > 0 Then
Cells(i, "D").Interior.ColorIndex = 36
End If
End If
Next
End Sub
I know it looks complicated but it should only take you 10-30 minutes depending on experience, and it will save you lots of time & eliminate the risk of duplicate ip's.
ps
the grins in the column D should be replaced with the same format as colums B & C. I.E ("C:C")