I have a user form that has a text box, and if a value is entered that matches a value in a column on another sheet I want the text box background color to turn red. If I do it in a cell on a worksheet I would use a VLookup:
How can I accomplish this using a Userform where the Text box identifies to the user that the value in this text box matches a value in the list so they are immediately notified that their ID that they just entere has been revoked?
Here is what I tried but it is not working:
Private Sub IDTextBox_Change()
If IDTextBox.Value = Sheet2.Range("F2:F271") Then
IDTextBox.BackColor = vbRed
Else
IDTextBox.BackColor = vbWhite
End If
End Sub
=IF(ISNA(VLOOKUP($C$5,Revocation!$F$2:$F$271,1,FALSE)), "", "REVOKED") |
How can I accomplish this using a Userform where the Text box identifies to the user that the value in this text box matches a value in the list so they are immediately notified that their ID that they just entere has been revoked?
Here is what I tried but it is not working:
Private Sub IDTextBox_Change()
If IDTextBox.Value = Sheet2.Range("F2:F271") Then
IDTextBox.BackColor = vbRed
Else
IDTextBox.BackColor = vbWhite
End If
End Sub