Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text color in cell
Any way to make one word in a cell RED with all other words black?
I am programming a macro and want one word to stand out from the others. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text color in cell
You can try this
It will make the first 5 Characters red Range("A1").Characters(Start:=1, Length:=5).Font.Color = vbRed -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Excel" wrote in message om... Any way to make one word in a cell RED with all other words black? I am programming a macro and want one word to stand out from the others. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text color in cell
One way to do it, if you know the start position and the
length of the word is: ActiveCell.Character(Start:=1,Length:=2).Font.Colo rIndex=3 -----Original Message----- Any way to make one word in a cell RED with all other words black? I am programming a macro and want one word to stand out from the others. . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text color in cell
Manually. Yes. Select the word in Edit mode and select the Red font.
Programmatically, more difficult. Use the Instr Function to find the start of the string, assuming that there is only one instance of the word in the cell. Knowing the starting position and length of the word, ........ Watch the line wrap. Sub ColorMe() Dim lngStart As Long lngStart = InStr(1, ActiveCell.Value, "Word") ActiveCell.Characters(Start:=lngStart, _ Length:=Len("Word")).Font.ColorIndex = 3 End Sub Tested using Excel 97SR2 on Windows 98SE, HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- Any way to make one word in a cell RED with all other words black? I am programming a macro and want one word to stand out from the others. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I fill one cell color with text html/rgb color from another | Excel Discussion (Misc queries) | |||
Can't format cell color/text color in Office Excel 2003 in fil | Excel Discussion (Misc queries) | |||
Make text color match cell color with macro? | Excel Discussion (Misc queries) | |||
Cell Fill Color and text color - changes for recipient | Excel Discussion (Misc queries) | |||
Can't format cell color/text color in Office Excel 2003 in files . | Excel Discussion (Misc queries) |