Format the cell text as red
Re: Format the cell text as red
thats teh point dont work i only want PART the answer in red as i described formatting " RED will make all red, i cant seem to get format font to red in PART of the selection??
Im lost on this one..
pete, I don't think it's possible to format a cell with a function...
Can't you split the formula ?
for example :
cell a1 : Today is :
cell b1 : Now()
Now you can format B1 as red
To format characters separately in same cell...
You say you want to have the text "Today is" in black and the date in red. Assuming your date is in mm/dd/yy format (8 characters), then invoke this code:
Sub EditCell()
With ActiveCell
.Font.ColorIndex = 3
.Characters(1, _
(ActiveCell.Characters.Count - 8)) _
.Font.ColorIndex = 1
End With
End Sub
If your date format is other than 8 characters, change the numeral 8 in the code to however many characters your date is formatted to be.
As you can probably tell, the second With structure statement is broken out onto 3 lines for easier readability here; it can go onto 1 line in your actual module for easier readability there.
HTH
Tom Urtis
Re: To format characters separately in same cell...
Good stuff. ill give it a spin, guess by function will be impossible, shame but VBA gets arround that so im very happy, cheers!