I have a Userform with one combobox and 5 textboxes. The following code I have so far does everything I want except for one thing. If for example I select the name Paul in my combobox it shows all the pertaining data in the 5 textboxes but when I edit in textbox1 for example to change his phone number and close the userform I do not see a change in the cell on my worksheet. Can anyone help me with this one?
Private Sub UserForm_Initialize()
Set xRg = Worksheets("My_Tables").Range("L2:Q7")
Me.ComboBox1.List = xRg.Columns(1).value
End Sub
Private Sub ComboBox1_Change()
Me.TextBox1.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 2, False)
Me.TextBox2.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 3, False)
Me.TextBox3.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 4, False)
Me.TextBox4.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 5, False)
Me.TextBox5.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 6, False)
End Sub
Private Sub CommandButton1_Click()
Load Confirm_Update
End Sub
Private Sub CommandButton2_Click()
update_volume.hide
End Sub
Private Sub update_Click()
Dim answer As Integer
answer = MsgBox("Are you sure you want to update the Prover Volume.", vbYesNo + vbQuestion, "Update Prover Volume?")
If answer = vbYes Then
Unload update_volume
Else
End If
End Sub
Private Sub UserForm_Initialize()
Set xRg = Worksheets("My_Tables").Range("L2:Q7")
Me.ComboBox1.List = xRg.Columns(1).value
End Sub
Private Sub ComboBox1_Change()
Me.TextBox1.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 2, False)
Me.TextBox2.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 3, False)
Me.TextBox3.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 4, False)
Me.TextBox4.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 5, False)
Me.TextBox5.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.value, xRg, 6, False)
End Sub
Private Sub CommandButton1_Click()
Load Confirm_Update
End Sub
Private Sub CommandButton2_Click()
update_volume.hide
End Sub
Private Sub update_Click()
Dim answer As Integer
answer = MsgBox("Are you sure you want to update the Prover Volume.", vbYesNo + vbQuestion, "Update Prover Volume?")
If answer = vbYes Then
Unload update_volume
Else
End If
End Sub