Hello,
Im trying to get the text box to go red if the value is over 318 and green if under.
This code works if I put the value directly into the code.
But I want the value to be based of the value in a cell in another worksheet. But the following code does not work and changes the textbox to red whatever the number i put in the box
Im trying to get the text box to go red if the value is over 318 and green if under.
This code works if I put the value directly into the code.
Code:
Private Sub TextBox24_Change()
If Textbox3.Text = "Cathode Mother Roll" And TextBox24.Value > "318" Then TextBox24.BackColor = RGB(255, 0, 0) 'Red
If Textbox3.Text = "Cathode Mother Roll" And TextBox24.Value <= "318" Then TextBox24.BackColor = RGB(0, 255, 0) 'Green
If Textbox3.Text = "Cathode Mother Roll" And TextBox24.Text = "-" Then TextBox24.BackColor = RGB(255, 255, 255) 'White
End Sub
But I want the value to be based of the value in a cell in another worksheet. But the following code does not work and changes the textbox to red whatever the number i put in the box
Code:
Private Sub TextBox24_Change()
If Textbox3.Text = "Cathode Mother Roll" And TextBox24.Value > [Specs!F28].value Then TextBox24.BackColor = RGB(255, 0, 0) 'Red
If Textbox3.Text = "Cathode Mother Roll" And TextBox24.Value <= [specs!F28].value Then TextBox24.BackColor = RGB(0, 255, 0) 'Green
If Textbox3.Text = "Cathode Mother Roll" And TextBox24.Text = "-" Then TextBox24.BackColor = RGB(255, 255, 255) 'White
End Sub