Hello Mike,
It is easier and faster to use the Dictionary Object. The Dictionary allows you to randomly check if something already exists. Here is an example...
Sub Check_B()
Dim Cell As Range
Dim MyName As Variant
Dim MyNames As Object
Dim Rng As Range
Dim RngEnd As Range
Set Rng = Range("A3:B3")
Set RngEnd = Cells(Rows.Count, Rng.Column).End(xlUp)
If RngEnd.Row < Rng.Row Then Exit Sub Else Set Rng = Range(Rng, RngEnd)
Set MyNames = CreateObject("Scripting.Dictionary")
MyNames.CompareMode = vbTextCompare
For Each Cell In Rng.Columns(1).Cells
MyName = Cell.Text & " " & Cell.Offset(0, 1).Text
If Not MyNames.Exists(MyName) Then
MyNames.Add MyName, 0
Else
MsgBox "That Name Already Exists !!! Please Try Again...", vbCritical, "Name Exists"
Cell.Resize(1, 2).ClearContents
Call LastName
End If
Next Cell
Set MyNames = Nothing
End Sub
Bookmarks