Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Textbox font color change (update, but still not quite there)

I just recently posted this question, and I've almost got it figured
out, but not quite. I have a form with a text box called textNotes.
The notes that are entered into this text box on the form get added to
a spreadsheet to update a 'notes' cell that is entered into a
variable name called 'myNotesRange' for a given report number. The
value in the myNotesRange gets put into a variable called
myNotesValue. I want to have the color of the text that gets added to
the spreadsheet be red. I was shown code to do this, and I think I'm
close, but I'm still getting an error message stating "Unable to set
the Text property of the Characters class". Here's what I have.


With Range(myNotesRange)
With .Characters(Len(myNotesValue) + 1, _
Len(textNotes.Text))
.Text = textNotes.Text ' this is where debug message shows
.Font.ColorIndex = 3
End With
End With

Thanks for any (continued) help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Textbox font color change (update, but still not quite there)

try this. I moved .value up in the code. Also had to change from .text to
..value.


With Range(myNotesRange)
.Value = textNotes.Text
With .Characters(Len(myNotesValue) + 1, _
Len(textNotes.Text))
.Font.ColorIndex = 3
End With
End With

"Phrank" wrote:

I just recently posted this question, and I've almost got it figured
out, but not quite. I have a form with a text box called textNotes.
The notes that are entered into this text box on the form get added to
a spreadsheet to update a 'notes' cell that is entered into a
variable name called 'myNotesRange' for a given report number. The
value in the myNotesRange gets put into a variable called
myNotesValue. I want to have the color of the text that gets added to
the spreadsheet be red. I was shown code to do this, and I think I'm
close, but I'm still getting an error message stating "Unable to set
the Text property of the Characters class". Here's what I have.


With Range(myNotesRange)
With .Characters(Len(myNotesValue) + 1, _
Len(textNotes.Text))
.Text = textNotes.Text ' this is where debug message shows
.Font.ColorIndex = 3
End With
End With

Thanks for any (continued) help.

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
Textbox font colour change? Tdp Excel Discussion (Misc queries) 6 January 24th 09 05:11 PM
How to have textbox font color change? Phrank Excel Programming 3 September 11th 07 04:14 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:38 AM.

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

About Us

"It's about Microsoft Excel"