![]() |
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!! |
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!! |
All times are GMT +1. The time now is 12:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com