Hi all
I have a text box and a command button, if i pass some specific values it will give me a message
but when the given value is entered it states " run time error, mismatch ". my code is below
should i change the text properties ?? let me know whats wrong with the two codes below
Private Sub CommandButton1_Click()
If TextBox1.Value = Application.WorksheetFunction.Trim("abc") Or _
Application.WorksheetFunction.Trim("def") Then
MsgBox "123"
End If
Private Sub CommandButton1_Click()
If TextBox1.Value = "123" Or "456" Then
MsgBox "abc"
End If
"The problem with this code for any number it is giving the message "abc"
which should not be the case. should message only for 123/456
Bookmarks