Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
frogtoad123
 
Posts: n/a
Default change font color on search

Hi, I need to do a search and replace in a worksheet. When I match a string,
I want to change the color.

For example, if the string is
"Hello everyone!"

I want to search for any word that starts and ends with 'e', then change the
word color to be blue.

Is this possible with a cell formula? Do I need a sheet macro? I cant seem
to figure it out with either!

Thanks in advance for any help! (Office 2003)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default change font color on search

What you are asking cannot be done with formulas. Neither with
conditional formatting, because you want formatting at text and not
cell level.

The following marco will highlight the word srch in all cells in the
range C1:D10 of Sheet1:

Sub Highlight(srch As String)
Dim dta As Range, c As Range

Set dta = Sheets("Sheet1").Range("C1:D10")
For Each c In dta
If InStr(1, c.Value, srch) Then
With c.Characters(Start:=InStr(1, c.Value, srch),
Length:=Len(srch)).Font
.ColorIndex = 41
End With
End If
Next c
End Sub

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default change font color on search

No it doesn't

"vezerid" wrote:

What you are asking cannot be done with formulas. Neither with
conditional formatting, because you want formatting at text and not
cell level.

The following marco will highlight the word srch in all cells in the
range C1:D10 of Sheet1:

Sub Highlight(srch As String)
Dim dta As Range, c As Range

Set dta = Sheets("Sheet1").Range("C1:D10")
For Each c In dta
If InStr(1, c.Value, srch) Then
With c.Characters(Start:=InStr(1, c.Value, srch),
Length:=Len(srch)).Font
.ColorIndex = 41
End With
End If
Next c
End Sub

HTH
Kostis Vezerides


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
can't change font Terri Excel Worksheet Functions 2 December 19th 05 08:15 PM
Can't change cell value with unusual font. Terri Excel Worksheet Functions 4 December 13th 05 09:41 PM
I can't change the font size in the printouts? james Excel Discussion (Misc queries) 2 September 10th 05 04:47 PM
how do i change font kerning Paul Osborn Excel Discussion (Misc queries) 1 July 24th 05 07:58 PM
How do I get the font color to change automatically depending on gtcarlsbad Excel Discussion (Misc queries) 2 February 1st 05 02:39 AM


All times are GMT +1. The time now is 01:54 AM.

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"