View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Frustrated IT Tech Frustrated IT Tech is offline
external usenet poster
 
Posts: 3
Default Changing the Color of Specific Characters using a Macro

Jim,

Thank you so much! I only have one more question, now that your code works
beautifully, how do i make the character both bold and change color?

Chris

"Jim Cone" wrote:

Chris,
Run another loop inside the first loop...
'--
Sub Color_Part_of_Cell()
Dim rCell As Range
Dim N As Long
For Each rCell In Selection
N = 1
Do
N = InStr(N, rCell.Value, "S#")
If N 0 Then
rCell.Characters(N, 1).Font.Color = vbRed
N = N + 1
End If
Loop Until N = 0
Next rCell
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Frustrated IT Tech"
wrote in message
Thank you Jim, but what if there is more than one in the same cell. I tried
that code and it only hit the first one in each cell.

Chris