I'm usingthis to check for duplicates ...however I cannot get the seltext to work,...
Private Sub TB_BOM_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'msgbox TB_
With Sheet1.Range("R1:R1000") 'TB_BOM.Text
Set C = .Find(TB_BOM.Value, LookIn:=xlFormulas, LookAt:=xlWhole)
If Not C Is Nothing Then
Cancel = True
MsgBox "dupPLICATE..."
With Me.TB_BOM
.SetFocus
.SelStart = Len(TB_BOM.Text) '- 1
.SelLength = 1
End With
End If
End With
'TB_BOM.SetFocus
End Sub
Private Sub TB_BOM_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'msgbox TB_
With Sheet1.Range("R1:R1000") 'TB_BOM.Text
Set C = .Find(TB_BOM.Value, LookIn:=xlFormulas, LookAt:=xlWhole)
If Not C Is Nothing Then
Cancel = True
MsgBox "dupPLICATE..."
With Me.TB_BOM
.SetFocus
.SelStart = Len(TB_BOM.Text) '- 1
.SelLength = 1
End With
End If
End With
'TB_BOM.SetFocus
End Sub