I have the following code. I have a drop down list in my combo box. But when I select a value (text) it does not populate the text box.
VBA Code:
Private Sub Combobox1_change()
Dim i As Long, LastRow As Long, ws As Worksheet
Set ws = Sheets("Sheet2")
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
If Val(Me.ComboBox1.Value) = ws.Cells(i, "A") Then
Me.txtFirstname = ws.Cells(i, "B").Value
End If
Next i
End Sub