Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
can I Custom Format just the characters: xx to be a yellow font? thanks
|
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Not possible using formatting
-- Regards, Peo Sjoblom "nastech" wrote in message ... can I Custom Format just the characters: xx to be a yellow font? thanks |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could use a macro.
Sub Color_String() Dim Rng As Range Dim cell As Range Dim start_str As Integer Set Rng = Selection For Each cell In Rng start_str = InStr(cell.Value, "xx") If start_str Then cell.Characters(start_str, 2).Font.ColorIndex = 6 End If Next End Sub Or make it a worksheet event. Paste into the sheet module. Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "A1:A10" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then Dim Rng As Range Dim cell As Range Dim start_str As Integer For Each cell In Target start_str = InStr(cell.Value, "xx") If start_str Then cell.Characters(start_str, 2).Font.ColorIndex = 6 End If Next End If ws_exit: Application.EnableEvents = True End Sub Gord Dibben MS Excel MVP On Mon, 9 Jul 2007 12:06:04 -0700, nastech wrote: can I Custom Format just the characters: xx to be a yellow font? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom Format xx="" | Excel Discussion (Misc queries) | |||
Scroll Bar missing "Control" tab in "Format Properties" dialog box | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
custom format cell, if value is 0, then write "-" | Excel Discussion (Misc queries) | |||
Any IF(A2=font color=red", "1", "0") in excel? Or a way to do it? | Excel Discussion (Misc queries) |