my userform contains 3 textBox and worksheet "sheet1" range A2 : A6
TextBox 1
TextBox 2
TextBox 3
i like if sheet1 range A2: A6 match value with any of the 3 TextBox value than
those TextBox Back color is "Red" ( only match value of TextBox)
how it is possible with vba code
Private Sub TextBox1_AfterUpdate()
Dim rng As Range, cell As Range
Set rng = Range("A2:A6")
For Each cell In rng
If TextBox1.Value = cell.Value And TextBox1.Value <> "" Then TextBox1.BackColor = vbRed
Next cell
End Sub
my problem is
when user cllick a command button than check the range A2:A6 to match value in all Three TextBox and match the value those TextBox back color is "Red".
how to check all three TextBox Value with Range A2:A6 value.