Hi geliedee
Add this Code to the UserForm Module
Private Sub UserForm_Activate()
Me.CommandButton2.Visible = False
End Sub
Modify this Code in the UserForm Module
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim ID As String
Dim ID2 As Range
Dim IDRow As Long
Set ws = Sheets("data base")
ID = TextBox1
Set ID2 = ws.Range("G:G").Find(what:=ID, LookIn:=xlValues, lookat:=xlWhole)
If ID2 Is Nothing Then
MsgBox "This ID does not appear in the data."
Exit Sub
Else
IDRow = ID2.Row
Me.CommandButton2.Visible = True '<---Add this Line of Code
End If
TextBox2 = ws.Cells(IDRow, 7)
TextBox3 = ws.Cells(IDRow, 1)
TextBox4 = ws.Cells(IDRow, 3)
TextBox5 = ws.Cells(IDRow, 8)
TextBox6 = ws.Cells(IDRow, 9)
TextBox7 = ws.Cells(IDRow, 11)
TextBox8 = ws.Cells(IDRow, 6)
TextBox9 = ws.Cells(IDRow, 4)
End Sub
Bookmarks