hi guys im rather new to excel and i've been trying to create a simple user form according to this video on youtube "Data Entry Form In VBA (PART-3)"
however, i've been getting the error "type mismatch" when i try to use application.match to match with a string value as the row i'm trying to match with is of string value.
converting it to Long type works for values with only numbers in them, i have to match with values that are a combination of alphabets, numbers, symbols like dash and backslash.
if i were to use the variant type how would i go about doing it?
please advise on how to match string or variant values , thank you.
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value <> "" Then
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Store") 'set sheet range, only for Store sheet'
Dim i As String
i = Application.Match((Me.ComboBox1.Value), sh.Range("A:A"), 0) 'match only with those in column A'
Me.TextBox2.Value = sh.Range("B" & i).Value
Me.TextBox3.Value = sh.Range("C" & i).Value
Me.TextBox4.Value = sh.Range("D" & i).Value
Me.TextBox5.Value = sh.Range("E" & i).Value
End If
End Sub
Bookmarks