I have a piece of code shown below.
I need to change it slightly but need help to do it.
I need it to display the message if findstring has been found more than once (i.e Twice)
Hope someone can help
Private Sub TextBox22_Exit(ByVal Cancel As MSForms.ReturnBoolean)
FindString = TextBox22.Value
If Trim(FindString) <> "" Then
With Sheets("2009").Range("A:A")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
MsgBox "Duplicate Found - Change Name"
TextBox22.Value = ""
Else
End If
End With
End If
End Sub
Bookmarks