Thank you so much for the help, Mumps1! Am really glad to join this group.
Just to let you know, I made few revisions, hoping it can help other newbies too...it's just actually to search and look for the exact ID match in the worksheet before it populates the new password for the particular staff. Here's my code to share: (I hope it will be posted right)
Private Sub CommandButton1_Click()
Dim ID As String
ID = TextBox1.Value
Dim c As Range
Set c = Sheets("Password").Cells.Find(what:=TextBox1.Text, LookIn:=xlFormulas, lookat:=xlWhole)
Dim NewPassword As String
NewPassword = TextBox2.Value
Dim bottomA As Integer
bottomA = Range("A" & Rows.Count).End(xlUp).Row
Sheets("Password").Activate
If c Is Nothing Then
MsgBox ("SAP ID not found.Please try again or contact administrator."), vbOKOnly
TextBox1.Text = Empty
TextBox2.Text = Empty
Else
For Each c In Sheets("Password").Range("A2:A" & bottomA)
If c = ID Then
c.Offset(0, 3) = NewPassword
eOK.Hide
End If
Next c
End If
End Sub
Bookmarks