Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros & vba
I'm using excel 2000.
How can I search a range of cells and get only those cells to change color if they meet certain criteria eg: "a text string"? So far I've only been able to get the entire range to change!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros & vba
Here are two ways:
By Conditional Formatting Highlight column A From the Format menu, Conditional Formatting Formula Is: =A1="a text string" or by Macro Sub test() Dim rng As Range With ActiveSheet For Each rng In Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp)) If rng.Value = "a text string" Then rng.Interior.Color = RGB(255, 0, 0) Next End With End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "spak1971" wrote in message ... I'm using excel 2000. How can I search a range of cells and get only those cells to change color if they meet certain criteria eg: "a text string"? So far I've only been able to get the entire range to change!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
weird saving of a document with macros resulting with macros being transfered to the copy | Excel Programming | |||
convert lotus 123w macros to excel macros | Excel Programming | |||
convert lotus 123w macros to excel macros | Excel Programming | |||
Open workbook-macros enabled, opening another with macros | Excel Programming | |||
Suppress the Disable Macros / Enable Macros Dialog | Excel Programming |