Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find duplicates in entire workbook | Excel Discussion (Misc queries) | |||
Find duplicates in entire workbook | Excel Discussion (Misc queries) | |||
change color of entire row by use conditional format | Excel Worksheet Functions | |||
color entire row by using conditional format | Excel Worksheet Functions | |||
color entire row by using conditional format | Excel Worksheet Functions |