Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a textbox linked to a cell in excel, which is already formatted as
"dd-mmm-yy". How can I also include in the texbox font colour to be the same as in the cell? I am using the following code to format the textbox: If IsDate(FoundCell.Offset(0, 1).Value) Then Me.TextBox1.Value = Format(FoundCell.Offset(0, 1).Value, "dd-mmm-yy") -- Tdp |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() ActiveSheet.TextBox1.ForeColor = 65280 "Tdp" wrote: I have a textbox linked to a cell in excel, which is already formatted as "dd-mmm-yy". How can I also include in the texbox font colour to be the same as in the cell? I am using the following code to format the textbox: If IsDate(FoundCell.Offset(0, 1).Value) Then Me.TextBox1.Value = Format(FoundCell.Offset(0, 1).Value, "dd-mmm-yy") -- Tdp |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Can I include your code with the following or does it have to be a seperate
code? Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") End Sub -- Tdp "Joel" wrote: ActiveSheet.TextBox1.ForeColor = 65280 "Tdp" wrote: I have a textbox linked to a cell in excel, which is already formatted as "dd-mmm-yy". How can I also include in the texbox font colour to be the same as in the cell? I am using the following code to format the textbox: If IsDate(FoundCell.Offset(0, 1).Value) Then Me.TextBox1.Value = Format(FoundCell.Offset(0, 1).Value, "dd-mmm-yy") -- Tdp |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
..Can be the same . I had the code in a module so I needed the activesheet..
The color will stay even if the text is changed. You only need the color change in the initialization code. You can also manually change the color if you don't want it in code. Change the worksheet to design mode by opening the following toolbar View - Toolbars - Control Toolbox Then press the triangle which is a toggle ICON (Design Mode). You then need to press again to return to operational mode.. Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") TextBox1.ForeColor = 65280 End Sub "Tdp" wrote: Can I include your code with the following or does it have to be a seperate code? Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") End Sub -- Tdp "Joel" wrote: ActiveSheet.TextBox1.ForeColor = 65280 "Tdp" wrote: I have a textbox linked to a cell in excel, which is already formatted as "dd-mmm-yy". How can I also include in the texbox font colour to be the same as in the cell? I am using the following code to format the textbox: If IsDate(FoundCell.Offset(0, 1).Value) Then Me.TextBox1.Value = Format(FoundCell.Offset(0, 1).Value, "dd-mmm-yy") -- Tdp |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks very much.
It seems to but when the colour on the spreadsheet changes to red, the textbox changes to Green!! If 65280= Green what would Orange and Red be? -- Tdp "Joel" wrote: .Can be the same . I had the code in a module so I needed the activesheet.. The color will stay even if the text is changed. You only need the color change in the initialization code. You can also manually change the color if you don't want it in code. Change the worksheet to design mode by opening the following toolbar View - Toolbars - Control Toolbox Then press the triangle which is a toggle ICON (Design Mode). You then need to press again to return to operational mode.. Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") TextBox1.ForeColor = 65280 End Sub "Tdp" wrote: Can I include your code with the following or does it have to be a seperate code? Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") End Sub -- Tdp "Joel" wrote: ActiveSheet.TextBox1.ForeColor = 65280 "Tdp" wrote: I have a textbox linked to a cell in excel, which is already formatted as "dd-mmm-yy". How can I also include in the texbox font colour to be the same as in the cell? I am using the following code to format the textbox: If IsDate(FoundCell.Offset(0, 1).Value) Then Me.TextBox1.Value = Format(FoundCell.Offset(0, 1).Value, "dd-mmm-yy") -- Tdp |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Pick your own shades. Go into design mode and press the triangle. Then
press the textbox and select the property icon on the tool bar. Go to forecolor and select. There is a pullwon menu that will pull up a box where you can select the color. After you sselect the color the number will be placed in the property window of the text box. Use the number for your macro. "Tdp" wrote: Thanks very much. It seems to but when the colour on the spreadsheet changes to red, the textbox changes to Green!! If 65280= Green what would Orange and Red be? -- Tdp "Joel" wrote: .Can be the same . I had the code in a module so I needed the activesheet.. The color will stay even if the text is changed. You only need the color change in the initialization code. You can also manually change the color if you don't want it in code. Change the worksheet to design mode by opening the following toolbar View - Toolbars - Control Toolbox Then press the triangle which is a toggle ICON (Design Mode). You then need to press again to return to operational mode.. Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") TextBox1.ForeColor = 65280 End Sub "Tdp" wrote: Can I include your code with the following or does it have to be a seperate code? Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") End Sub -- Tdp "Joel" wrote: ActiveSheet.TextBox1.ForeColor = 65280 "Tdp" wrote: I have a textbox linked to a cell in excel, which is already formatted as "dd-mmm-yy". How can I also include in the texbox font colour to be the same as in the cell? I am using the following code to format the textbox: If IsDate(FoundCell.Offset(0, 1).Value) Then Me.TextBox1.Value = Format(FoundCell.Offset(0, 1).Value, "dd-mmm-yy") -- Tdp |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
OK Joel I shall try that.
Thank you for your help. -- Tdp "Joel" wrote: Pick your own shades. Go into design mode and press the triangle. Then press the textbox and select the property icon on the tool bar. Go to forecolor and select. There is a pullwon menu that will pull up a box where you can select the color. After you sselect the color the number will be placed in the property window of the text box. Use the number for your macro. "Tdp" wrote: Thanks very much. It seems to but when the colour on the spreadsheet changes to red, the textbox changes to Green!! If 65280= Green what would Orange and Red be? -- Tdp "Joel" wrote: .Can be the same . I had the code in a module so I needed the activesheet.. The color will stay even if the text is changed. You only need the color change in the initialization code. You can also manually change the color if you don't want it in code. Change the worksheet to design mode by opening the following toolbar View - Toolbars - Control Toolbox Then press the triangle which is a toggle ICON (Design Mode). You then need to press again to return to operational mode.. Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") TextBox1.ForeColor = 65280 End Sub "Tdp" wrote: Can I include your code with the following or does it have to be a seperate code? Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Value = Format(TextBox2.Value, "dd-mmm-yy") End Sub -- Tdp "Joel" wrote: ActiveSheet.TextBox1.ForeColor = 65280 "Tdp" wrote: I have a textbox linked to a cell in excel, which is already formatted as "dd-mmm-yy". How can I also include in the texbox font colour to be the same as in the cell? I am using the following code to format the textbox: If IsDate(FoundCell.Offset(0, 1).Value) Then Me.TextBox1.Value = Format(FoundCell.Offset(0, 1).Value, "dd-mmm-yy") -- Tdp |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FONT COLOUR CHANGE | Excel Worksheet Functions | |||
textbox font colour | Excel Discussion (Misc queries) | |||
Change colour of font in a textbox? | Excel Discussion (Misc queries) | |||
Change font colour | Excel Discussion (Misc queries) | |||
Change font colour for whole row | Excel Worksheet Functions |