Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default Textbox font colour change?

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Textbox font colour change?


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   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default Textbox font colour change?

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Textbox font colour change?

..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   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default Textbox font colour change?

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Textbox font colour change?

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   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default Textbox font colour change?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FONT COLOUR CHANGE natasha90 Excel Worksheet Functions 3 July 11th 08 09:19 PM
textbox font colour Pilot Excel Discussion (Misc queries) 2 March 25th 08 03:13 PM
Change colour of font in a textbox? capt Excel Discussion (Misc queries) 2 January 24th 08 04:51 PM
Change font colour Stefi Excel Discussion (Misc queries) 1 March 28th 07 01:54 AM
Change font colour for whole row Saleee Excel Worksheet Functions 2 October 10th 06 06:41 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"