How to have textbox font color change?

P

Phrank

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
 
G

Guest

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.
 
P

Phrank

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top