Excel vba macro - check and highlight cell?

?

.

Hello, seems simple but can't seem to find much info...how does one create a
user vba function within Excel 2007 to check a cell (or range of cells) for
a certain value and then highlight the matching cell? Thanks in advance.
 
J

Jim Cone

Conditional Formatting.


Hello, seems simple but can't seem to find much info...how does one create a
user vba function within Excel 2007 to check a cell (or range of cells) for
a certain value and then highlight the matching cell? Thanks in advance.
 
?

.

Thanks for your reply Jim, much appreciate. Out of curiousity are there
samples of how to do it through vba code like using the Range objects and
such?
 
J

Jim Cone

'Nothing related to Cond Formatting below.
'Code just finds the cells and colors them.
'--
Sub HeLikesDots()
Const Sludge As Double = 7113
Dim rCell As Range

Range("B5:E100").Interior.ColorIndex = xlColorIndexNone
For Each rCell In Range("B5:E100")
If rCell.Value = Sludge Then rCell.Interior.ColorIndex = 5 'Blue
Next
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html

..
..
..

"." <[email protected]>
wrote in message
Thanks for your reply Jim, much appreciate. Out of curiousity are there
samples of how to do it through vba code like using the Range objects and
such?
 
Top