ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
Hi,
Can you advise please what ive missed in the code below.
I run the code.
I see the msg box with the oK button.
Pressing OK just does nothing & im unable to close the msgbox.
Can you advise please what ive missed in the code below.
I run the code.
I see the msg box with the oK button.
Pressing OK just does nothing & im unable to close the msgbox.
Code:
Option Explicit
Private Sub DatabaseCustomerDuplicateSearch_Click()
Dim Cell As Variant
Dim Source As Range
Set Source = Range("A6:A5000")
For Each Cell In Source
If Application.WorksheetFunction.CountIf(Source, Cell) > 1 Then
Cell.Interior.Color = RGB(0, 255, 0)
Else
MsgBox " NO DUPLICATES WERE FOUND ", vbExclamation, "DATABASE DUPLICATE CHECKER"
End If
Next
End Sub