(Solved) – Using text values in Combobox


I would like to also use text values to populate textbox one to four right now only number values will fetch data in the textbox, I know I am overlooking a pretty simple thing but can’t seem to find out what?

Private Sub ComboBox1_Change()
Dim i As Long, LastRow As Long, ws As Worksheet
Set ws = Sheets("Sheet1")
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row

For i = 2 To LastRow
    If Val(Me.ComboBox1.Value) = ws.Cells(i, "A") Then
        MsgBox Me.ComboBox1.Value
        Me.TextBox1 = ws.Cells(i, "B").Value
        Me.TextBox2 = ws.Cells(i, "C").Value
        Me.TextBox3 = ws.Cells(i, "D").Value
        Me.TextBox4 = ws.Cells(i, "E").Value
    End If

Next i

End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *