The code "If Val(ComboBox1) = Sheets("Sheet3").Cells(i,1) " works for the numbers but not for the strings. If, however, I amend the code to:
the problem is solved.Code:Private Sub Frequencies() For i = 2 To 5 If Val(ComboBox1) = Sheets("Sheet3").Cells(i, 1) Then TextBox1 = Cells(i, 2) ElseIf ComboBox1 = Sheets("Sheet3").Cells(i, 1) Then TextBox1 = Cells(i, 2) End If Next i End Sub
So thanks, kaliman79912.




Reply With Quote