Textbox font color change (update, but still not quite there)

P

Phrank

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

Guest

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
 

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