Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Use conditional formating to find one word in a column.

I am trying to use conditional formating to find one word in a column of
cells and highlight just the one word regardless of how many words in that
cell. Has anyone come across this.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 341
Default Use conditional formating to find one word in a column.

You can't highlight just that one word with conditional formatting.
Conditional formatting is applied to the whole cell.

You can highlight all cells with the word allllen in them with something
like this in the conditional formatting for cell A1:
Formula is =NOT(ISERROR(FIND("allllen",A1)))

then copy, edit pastespecial formats to other cells you want to
highlight.

You could conceivably highlight just that one word with some *very* advanced
programming but that is way beyond me.
--
Allllen


"Betty" wrote:

I am trying to use conditional formating to find one word in a column of
cells and highlight just the one word regardless of how many words in that
cell. Has anyone come across this.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Use conditional formating to find one word in a column.

Betty,

CF won't work - you need to use VBA: see the macro below.

HTH,
Bernie
MS Excel MVP

Sub RedBold()
Dim c As Range
Dim d As Range
Dim mycell As Range
Dim myStart As Integer
Dim mylen As Integer
Dim myFindString As String
Dim firstAddress As String

myFindString = InputBox("Enter the word(s) to make Red & Bold", , "Betty")

'find the instances
With Application.InputBox("Select the Range", Type:=8)

Set c = .Find(myFindString, LookIn:=xlValues, LookAt:=xlPart)

If Not c Is Nothing Then
Set d = c
firstAddress = c.Address
Else:
MsgBox "Not Found"
End
End If

Set c = .FindNext(c)
If Not c Is Nothing And c.Address < firstAddress Then
Do
Set d = Union(d, c)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

'Change to Red and Bold
For Each mycell In d
myStart = InStr(1, mycell.Value, myFindString)
mylen = Len(myFindString)
With mycell.Characters(Start:=myStart, Length:=mylen).Font
.FontStyle = "Bold"
.ColorIndex = 3
End With
Next mycell

End Sub






"Betty" wrote in message
...
I am trying to use conditional formating to find one word in a column of
cells and highlight just the one word regardless of how many words in that
cell. Has anyone come across this.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Column picked randomly with probability relative to number of entr Neil Goldwasser Excel Worksheet Functions 4 May 30th 06 08:55 AM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
column to column conditional formatting won't work, need formula rrupp Excel Worksheet Functions 1 August 23rd 05 10:06 PM


All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"