I would appreciate some assistance applying condtional formatting to a textbox that contains the result of this formula
Range("T8") [From another active WS] also contains a formula that will return a variable amount (If TRUE) or "£0.00" (If FALSE).
Values in TextBox2 will be as TEXT
I am trying to apply conditional formatting to TextBox2 when the returned value is the variable amount (i.e. the value is not either "Not Active" or "£0.00")
I have tried the following code, but this applies the formatting to any value, I assume because the actual content of TextBox2 is a formula and not a text value
I have also tried using TextBox2.Text and TextBox2.Value
I have even tried adding the folowing but without success.
If TextBox2.= "Not Active" Then TextBox2.BackColor = RGB(0, 0, 0)
If TextBox2 = "£0.00" Then TextBox2.BackColor = RGB(0, 0, 0)
Thanks in advance
VBA Code:
If TextBox1.Value = "No" Then
TextBox2.Value = "Not Active"
Else
TextBox2 = Range("T8").Text
Range("T8") [From another active WS] also contains a formula that will return a variable amount (If TRUE) or "£0.00" (If FALSE).
Values in TextBox2 will be as TEXT
I am trying to apply conditional formatting to TextBox2 when the returned value is the variable amount (i.e. the value is not either "Not Active" or "£0.00")
I have tried the following code, but this applies the formatting to any value, I assume because the actual content of TextBox2 is a formula and not a text value
VBA Code:
Private Sub TextBox2_Change()
If TextBox2 = "Not Active" Or Not "£0.00" Then
TextBox2.BackColor = RGB(0, 255, 0)
End If
End Sub
I have also tried using TextBox2.Text and TextBox2.Value
I have even tried adding the folowing but without success.
If TextBox2.= "Not Active" Then TextBox2.BackColor = RGB(0, 0, 0)
If TextBox2 = "£0.00" Then TextBox2.BackColor = RGB(0, 0, 0)
Thanks in advance