ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Cond Format any word with 'fraud' in it (https://www.excelbanter.com/excel-discussion-misc-queries/224937-cond-format-any-word-fraud.html)

Lorinda

Cond Format any word with 'fraud' in it
 
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?

Dave Peterson

Cond Format any word with 'fraud' in it
 
Conditional formatting applies to the entire cell--not just a word within a
string of words.



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?


--

Dave Peterson

Lorinda

Cond Format any word with 'fraud' in it
 
Yeah, that's been my experience all afternoon...Is there anything to using
Find/Replace with Formatting to do this? In Excel or Word?

"Dave Peterson" wrote:

Conditional formatting applies to the entire cell--not just a word within a
string of words.



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?


--

Dave Peterson


Gord Dibben

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?



Dave Peterson

Cond Format any word with 'fraud' in it
 
Nothing built into excel that would allow you to do just change the format of a
single word in a cell that contains multiple words.

MSWord can change the formatting of a single word, though.

Lorinda wrote:

Yeah, that's been my experience all afternoon...Is there anything to using
Find/Replace with Formatting to do this? In Excel or Word?

"Dave Peterson" wrote:

Conditional formatting applies to the entire cell--not just a word within a
string of words.



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?


--

Dave Peterson


--

Dave Peterson

Lorinda

Cond Format any word with 'fraud' in it
 
Thanks you guys, I gave up on excel yesterday and did this in Word with
Find/Replace...
"Gord Dibben" wrote:

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?





All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com