Is this what you mean?
Private Sub cmdSave_Click()
Dim i&, c&, r&
Dim f As Range, fa
Dim sMsg$
If txtSearch.Text = "" Or Not IsNumeric(txtCount.Text) Then
sMsg = "Not enough info."
Else
With Sheet1
Set f = .Range("A:A").Find(what:=txtSearch.Text, lookat:=xlWhole)
If Not f Is Nothing Then
fa = f.Address
r = .Range(f.Address).Row
c = .Cells(r, Columns.Count).End(xlToLeft).Offset(0, 1).Column
Do
i = i + 1
Set f = .Range("A:A").FindNext(f)
Loop While Not f Is Nothing And fa <> f.Address
If i > 1 Then
sMsg = "More than one match found."
Else
sMsg = "Done"
.Cells(r, c) = txtCount.Text
End If
Else
sMsg = "'" & txtSearch.Text & "' not found."
End If
End With
End If
MsgBox sMsg
End Sub
Bookmarks