Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Find character in entire workbook and format color

Hi All,

Is there an efficient way via VBA to find cell values w/ a certain
character and change the color / font properties? For example, I want
to find all cells that have an "*" in it and change the color to a
bolded green. I tried doing a record macro, but didn't have any luck.
Sorry for asking such a noob question.

TIA.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find character in entire workbook and format color

Sub AAAB()
Dim oFound As Range
Dim firstaddress As String
For Each sh In Worksheets
firstaddress = ""
Set oFound = sh.Cells.Find("*~**", _
LookIn:=xlValues, LookAt:=xlWhole)
If Not oFound Is Nothing Then
firstaddress = oFound.Address
Do
oFound.Font.ColorIndex = 43
oFound.Font.Bold = True
Set oFound = sh.Cells.FindNext(oFound)
Loop While oFound.Address < firstaddress
End If
Next
End Sub

--
Regards,
Tom Ogilvy

"CST" wrote in message
om...
Hi All,

Is there an efficient way via VBA to find cell values w/ a certain
character and change the color / font properties? For example, I want
to find all cells that have an "*" in it and change the color to a
bolded green. I tried doing a record macro, but didn't have any luck.
Sorry for asking such a noob question.

TIA.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Find character in entire workbook and format color

Thanks Tom, you Rule! This works perfectly.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Find duplicates in entire workbook Parker Excel Discussion (Misc queries) 2 July 22nd 09 10:24 AM
Find duplicates in entire workbook Mukesh Excel Discussion (Misc queries) 4 June 6th 09 08:46 AM
change color of entire row by use conditional format Montu Excel Worksheet Functions 2 November 15th 07 10:02 AM
color entire row by using conditional format capital letter Excel Worksheet Functions 1 November 10th 07 09:55 AM
color entire row by using conditional format capital letter Excel Worksheet Functions 1 November 10th 07 09:24 AM


All times are GMT +1. The time now is 12:03 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"