LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing cell colour depending on content??


Hi all, I am trying to get cells in a certain range to change colou
depending on their content, i need to check for a name and any othe
word in the cell i.e Cheryl Home where home could be a variable (als
it shouldnt matter what case it is in) then when it finds the name an
variable change the cells colour and leave only the variable visible i
the cell!

Here's what i have so far it doesn't quite work!
Dim mycell
Dim rng As Range
Set rng = Range("B4:M46")
For Each mycell In rng
If mycell = "" Then
Exit Sub
ElseIf mycell.Value = "Cheryl" & "*" Then
mycell.Select
End If
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
If mycell.Value = "Emma" & "*" Then
mycell.Select
End If
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
If mycell.Value = "Lauren" & "*" Then
mycell.Select
End If
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Next

Hope you can help!

Reagrds
Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=55206

 
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
Changing font colour depending on cell value RunRonnyRun Excel Worksheet Functions 1 October 27th 08 08:28 PM
how do i change cell background colour depending on its content? demble Excel Discussion (Misc queries) 2 May 2nd 07 05:50 PM
Changing Colour of Bar depending on Value Campbell Charts and Charting in Excel 1 March 31st 06 01:16 PM
changing the colour of cells depending on the content. johnny.exe Excel Discussion (Misc queries) 3 January 26th 06 09:41 AM
Changing cell colour depending on another cells value... Web master Excel Discussion (Misc queries) 3 January 10th 06 12:30 PM


All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"