Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default How to have textbox font color change?

I've got a form with a text box called Notes. The notes get added to
a spreadsheet to update a NOTES cell for a given report number. I
want to have the color of the text that gets added to the spreadsheet
be red, but I can't figure out how to do this. It's not the whole
Notes cell that I want to change the color, but rather just the text
that is entered via the Notes text box. I have a few forms where
different people enter Notes into the same cell, and the notes get
concatenated. Having these notes color coded will help identify where
they came from. Thanks for any help.

Frank
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to have textbox font color change?

Private Sub CommandButton2_Click()
With Range("Notes")
With .Characters(Len(.Text) + 1, _
Len(Me.Controls("Notes").Text))
.Text = Me.Controls("Notes").Text
.Font.ColorIndex = 3
End With
End With
End Sub

Worked for me.

--
Regards,
Tom Ogilvy



"Phrank" wrote:

I've got a form with a text box called Notes. The notes get added to
a spreadsheet to update a NOTES cell for a given report number. I
want to have the color of the text that gets added to the spreadsheet
be red, but I can't figure out how to do this. It's not the whole
Notes cell that I want to change the color, but rather just the text
that is entered via the Notes text box. I have a few forms where
different people enter Notes into the same cell, and the notes get
concatenated. Having these notes color coded will help identify where
they came from. Thanks for any help.

Frank

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default How to have textbox font color change?

Hi Tom,

I tried this a couple different ways, and I kept getting errors. Where
you have Range("Notes"), are you referring to the actual cell where
the notes are entered, or are you referring to the textbox in which
the note is entered? I have the notes cell identified as
'myNotesRange', and the notes textbox is called textNotes. I
appreciate your help (and you have helped me out a lot in the past
too!).

Frank

On Sat, 8 Sep 2007 19:32:01 -0700, Tom Ogilvy
wrote:

Private Sub CommandButton2_Click()
With Range("Notes")
With .Characters(Len(.Text) + 1, _
Len(Me.Controls("Notes").Text))
.Text = Me.Controls("Notes").Text
.Font.ColorIndex = 3
End With
End With
End Sub

Worked for me.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to have textbox font color change?

I've got a form with a text box called Notes. The notes get added to
a spreadsheet to update a NOTES cell for a given report number


That says to me the Notes cell is named "Notes" (insert=Name =Define,
Name: Notes, Refers to: =Sheet1!$B$9

as an example.

--
Regards,
Tom Ogilvy

"Phrank" wrote:

Hi Tom,

I tried this a couple different ways, and I kept getting errors. Where
you have Range("Notes"), are you referring to the actual cell where
the notes are entered, or are you referring to the textbox in which
the note is entered? I have the notes cell identified as
'myNotesRange', and the notes textbox is called textNotes. I
appreciate your help (and you have helped me out a lot in the past
too!).

Frank

On Sat, 8 Sep 2007 19:32:01 -0700, Tom Ogilvy
wrote:

Private Sub CommandButton2_Click()
With Range("Notes")
With .Characters(Len(.Text) + 1, _
Len(Me.Controls("Notes").Text))
.Text = Me.Controls("Notes").Text
.Font.ColorIndex = 3
End With
End With
End Sub

Worked for me.


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
Change colour of font in a textbox? capt Excel Discussion (Misc queries) 2 January 24th 08 04:51 PM
Change font and size of a textbox Jos Vens[_3_] Excel Programming 2 May 3rd 06 09:59 AM
Userform-Change textbox color and font based on input in other tex Neal Excel Programming 2 July 22nd 05 12:16 AM
Changing font color of textbox text..... jan Excel Programming 5 January 31st 05 08:10 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM


All times are GMT +1. The time now is 03:13 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"