How to add or edit combo box values directly in following code? When writing a text in a combo box, show error "worksheetfunction" And I can not add a new code.
Private Sub UserForm_Click()
Dim xRg As Range
Private Sub UserForm_Initialize()
Set xRg = Worksheets("Sheet1").Range("A2:B8")
Me.ComboBox1.List = xRg.Columns(1).Value
End Sub
Private Sub ComboBox1_Change()
Dim xRg As Range
Set xRg = Worksheets("Sheet1").Range("A2:B8")
Me.TextBox1.Text = Application.WorksheetFunction _
.VLookup(Me.ComboBox1.Value, xRg, 2, False)
End Sub