Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Red if Less than 50
Hi Everyone,
I have a textbox in userform, I want to change the TextColor (interior color) if the value is less than 50 then it will be Blue. (to show the quantity is less) Regards. Shahzad |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Red if Less than 50
On Aug 4, 4:12*pm, Shazi wrote:
Hi Everyone, I have a textbox in userform, I want to change the TextColor (interior color) if the value is less than 50 then it will be Blue. (to show the quantity is less) Regards. Shahzad Hello try this Private Sub TextBox1_Change() If TextBox1.Value < 50 Then TextBox1.BackColor = &HFF0000 Else TextBox1.BackColor = &HFFFFFF End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Red if Less than 50
This way maybe...
Private Sub TextBox1_Change() If Val(TextBox1.Text) < 50 Then TextBox1.BackColor = vbRed Else TextBox1.BackColor = vbWhite End If End Sub Rick "Shazi" wrote in message ... Hi Everyone, I have a textbox in userform, I want to change the TextColor (interior color) if the value is less than 50 then it will be Blue. (to show the quantity is less) Regards. Shahzad |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Red if Less than 50
Sorry, I couldn't tell if you were trying to change the font color or
the text box color. my previous post will change the text box color, the code below will change the font color. Private Sub TextBox1_Change() If TextBox1.Value < 50 Then TextBox1.ForeColor = &HFF0000 Else TextBox1.ForeColor = &HFFFFFF End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
set color of textbox (shape) bullets | Excel Programming | |||
How to have textbox font color change? | Excel Programming | |||
Match TextBox Back Color to Cell Fill Color | Excel Programming | |||
TextBox Color Change | Excel Programming | |||
Browse Forms Controls and change TextBox color based on cell color | Excel Programming |