Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 9
Default change background color based on range value

I would like to search a spread sheet for a specific range value Ie

c1 c2 c3 c4 c5 c6
20 30 40
20 30 40

When 20 30 and 40 are found in neighboring columns I would like to turn the
background of these 3 cells blue. How would I code this?

Thanks in advance - Dan
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 49
Default change background color based on range value

Use conditional formatting over the first range.

Set condition 1 to Formula-is option and in next box add
=COUNTIF($D$1:$F$5,A1)0
Format as appropriate.

$D$1:$F$5 is range being tested. Change as appropriate.
A1 is the first cell of the range being conditionally formatted.

There are lots of Youtube vids which may prove informative if you
want to learn more. Type conditional formatting in the site search
box to find vids on this particular aspect of Excel.

Regards
Paul



"DanL" wrote in message
...
I would like to search a spread sheet for a specific range value Ie

c1 c2 c3 c4 c5 c6
20 30 40
20 30 40

When 20 30 and 40 are found in neighboring columns I would like to turn
the
background of these 3 cells blue. How would I code this?

Thanks in advance - Dan



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default change background color based on range value

Sub findgroups()
'With Worksheets(1).Range("a1:z500")
Set c = Cells.Find(20, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Offset(, 1) = 30 And c.Offset(, 2) = 40 Then
c.Resize(, 3).Interior.ColorIndex = 33
End If
Set c = Cells.FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
'End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DanL" wrote in message
...
I would like to search a spread sheet for a specific range value Ie

c1 c2 c3 c4 c5 c6
20 30 40
20 30 40

When 20 30 and 40 are found in neighboring columns I would like to turn
the
background of these 3 cells blue. How would I code this?

Thanks in advance - Dan


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
change the color of cell background based on a result Rich Excel Worksheet Functions 2 January 27th 09 07:17 PM
Change background color based on value in column A JT Innovations Excel Discussion (Misc queries) 4 January 23rd 09 07:14 PM
How do I change background color of highlighted Excel range ? Jim Excel Discussion (Misc queries) 0 June 6th 08 07:59 PM
Auto change background of color based on formula fredwing Excel Worksheet Functions 3 January 4th 07 12:45 AM
Change font and background color of several cells based on result of a formula Zenaida Excel Discussion (Misc queries) 2 April 27th 06 06:46 PM


All times are GMT +1. The time now is 10:08 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"