Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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
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
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM
convert lotus 123w macros to excel macros rpiescik[_2_] Excel Programming 1 September 19th 04 12:41 PM
convert lotus 123w macros to excel macros rpiescik Excel Programming 1 September 18th 04 01:35 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


All times are GMT +1. The time now is 09:02 AM.

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"