Hello All,
I have a userform with 2 texboxes where I scan a barcode in both and if they match the textboxes turn green and red if no match, I am trying to show an error message if there if no match
then clear both textboxes but I can not figure out how to do it as I am very new to VBA, could anyone help.
Below is what I have at the minute.
Private sub TextBox2_Change ()
If TextBox5.Text = TextBox2.Text then
TextBox2.Backcolor = RGB(51, 255, 51)
I have a userform with 2 texboxes where I scan a barcode in both and if they match the textboxes turn green and red if no match, I am trying to show an error message if there if no match
then clear both textboxes but I can not figure out how to do it as I am very new to VBA, could anyone help.
Below is what I have at the minute.
Private sub TextBox2_Change ()
If TextBox5.Text = TextBox2.Text then
TextBox2.Backcolor = RGB(51, 255, 51)
TextBox5.Backcolor = RGB(51, 255, 51)
Else
Else
TextBox2.Backcolor = RGB(255, 0, 0)
TextBox5.Backcolor = RGB(255, 0, 0)
End If
End Sub
Regards
TextBox5.Backcolor = RGB(255, 0, 0)
End If
End Sub
Regards