View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Cond Format any word with 'fraud' in it

The word is part of a text string in a cell or cells?

CF will not color just one word in a cell.

You would need VBA macro to achieve that.

Here is a simple one which colors just the first instance of "fraud" in a
string.

Won't work on words like "fraudulent"

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, "fraud")
If start_str Then
Cell.Characters(start_str, 5).Font.ColorIndex = 3
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Thu, 19 Mar 2009 15:04:01 -0700, Lorinda
wrote:

A spreadsheet full of cells with lots of text, no other formula/format. Can I
use conditional formatting to color any word that is like 'fraud' red and
leave the rest alone?