When make change in textbox on Userform

Status
Not open for further replies.

obiwann

Board Regular
Joined
Jan 2, 2014
Messages
142
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
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Status
Not open for further replies.

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top