I cannot figure out where to enter an error message box if code can't find the entered value. Any suggestions?
Private Sub CommandButton1_Click()
Dim myString As String
Dim FoundCell As Range
myString = Trim(userform1.TextBox1.Value)
If myString = vbNullString Then
Exit Sub
End If
With Sheets("System").Range("A:A")
Set FoundCell = .Find(what:=myString, after:=.Cells(1, 1), LookAt:=xlWhole)
FoundCell.EntireRow.Copy
End With
Sheets("Risk").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial
End Sub
Private Sub CommandButton1_Click()
Dim myString As String
Dim FoundCell As Range
myString = Trim(userform1.TextBox1.Value)
If myString = vbNullString Then
Exit Sub
End If
With Sheets("System").Range("A:A")
Set FoundCell = .Find(what:=myString, after:=.Cells(1, 1), LookAt:=xlWhole)
FoundCell.EntireRow.Copy
End With
Sheets("Risk").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial
End Sub