Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm on the home straight now (I think). What I would like to do is make text
in a text box go red if a certain condition is met. ie. If rider1.value 700 Then rider1.font = colour red (or whatever the correct code for this is) Thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If rider1 700 Then
rider1.Font.ColorIndex = 3 Else rider1.Font.ColorIndex = xlAutomatic End If But you can accomplish the same thing using conditional formatting, without any code at all. Format -- Cells --Conditional Format Then set up for cell value 700 and set the font color. "NDBC" wrote: I'm on the home straight now (I think). What I would like to do is make text in a text box go red if a certain condition is met. ie. If rider1.value 700 Then rider1.font = colour red (or whatever the correct code for this is) Thanks |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for the reply. Does conditional formatting work in text boxes on user
forms. "JLatham" wrote: If rider1 700 Then rider1.Font.ColorIndex = 3 Else rider1.Font.ColorIndex = xlAutomatic End If But you can accomplish the same thing using conditional formatting, without any code at all. Format -- Cells --Conditional Format Then set up for cell value 700 and set the font color. "NDBC" wrote: I'm on the home straight now (I think). What I would like to do is make text in a text box go red if a certain condition is met. ie. If rider1.value 700 Then rider1.font = colour red (or whatever the correct code for this is) Thanks |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
JL
Just tried that and am getting an error. I clicked on the textbox object and the name is rider1 (Rider1 TextBox at top). I want the text in this box to be red based on the value of the text/number entered in the box. I think I must be refering to the textbox incorrectly. Any ideas. "JLatham" wrote: If rider1 700 Then rider1.Font.ColorIndex = 3 Else rider1.Font.ColorIndex = xlAutomatic End If But you can accomplish the same thing using conditional formatting, without any code at all. Format -- Cells --Conditional Format Then set up for cell value 700 and set the font color. "NDBC" wrote: I'm on the home straight now (I think). What I would like to do is make text in a text box go red if a certain condition is met. ie. If rider1.value 700 Then rider1.font = colour red (or whatever the correct code for this is) Thanks |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Nope, that code won't work with a textbox - it works with a cell. I didn't
realize we were talking about text boxes, since textboxes don't have numeric values that you can test, they contain text/words/numers that are text and not really numbers. I've got to rush off right now, but I'll work up something for the textbox shortly - where did the textbox come from? The "Controls Toolbox" group or the "Forms" group. "NDBC" wrote: JL Just tried that and am getting an error. I clicked on the textbox object and the name is rider1 (Rider1 TextBox at top). I want the text in this box to be red based on the value of the text/number entered in the box. I think I must be refering to the textbox incorrectly. Any ideas. "JLatham" wrote: If rider1 700 Then rider1.Font.ColorIndex = 3 Else rider1.Font.ColorIndex = xlAutomatic End If But you can accomplish the same thing using conditional formatting, without any code at all. Format -- Cells --Conditional Format Then set up for cell value 700 and set the font color. "NDBC" wrote: I'm on the home straight now (I think). What I would like to do is make text in a text box go red if a certain condition is met. ie. If rider1.value 700 Then rider1.font = colour red (or whatever the correct code for this is) Thanks |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try
Me.TextBox1.ForeColor = vbRed If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: JL Just tried that and am getting an error. I clicked on the textbox object and the name is rider1 (Rider1 TextBox at top). I want the text in this box to be red based on the value of the text/number entered in the box. I think I must be refering to the textbox incorrectly. Any ideas. "JLatham" wrote: If rider1 700 Then rider1.Font.ColorIndex = 3 Else rider1.Font.ColorIndex = xlAutomatic End If But you can accomplish the same thing using conditional formatting, without any code at all. Format -- Cells --Conditional Format Then set up for cell value 700 and set the font color. "NDBC" wrote: I'm on the home straight now (I think). What I would like to do is make text in a text box go red if a certain condition is met. ie. If rider1.value 700 Then rider1.font = colour red (or whatever the correct code for this is) Thanks |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you, it worked without the me. at the start.
"Jacob Skaria" wrote: Try Me.TextBox1.ForeColor = vbRed If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: JL Just tried that and am getting an error. I clicked on the textbox object and the name is rider1 (Rider1 TextBox at top). I want the text in this box to be red based on the value of the text/number entered in the box. I think I must be refering to the textbox incorrectly. Any ideas. "JLatham" wrote: If rider1 700 Then rider1.Font.ColorIndex = 3 Else rider1.Font.ColorIndex = xlAutomatic End If But you can accomplish the same thing using conditional formatting, without any code at all. Format -- Cells --Conditional Format Then set up for cell value 700 and set the font color. "NDBC" wrote: I'm on the home straight now (I think). What I would like to do is make text in a text box go red if a certain condition is met. ie. If rider1.value 700 Then rider1.font = colour red (or whatever the correct code for this is) Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formatting - Code to colour 3+ text values differently | Excel Discussion (Misc queries) | |||
remove text with format code for phone numbers | Excel Discussion (Misc queries) | |||
Conditionl format a cell to change text colour | Excel Discussion (Misc queries) | |||
Conditional Format to Retain Text Colour from a List on another Sh | New Users to Excel | |||
Can i format (colour) selective text in a cell using excel2000? | Excel Discussion (Misc queries) |