Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing font colour depending on cell value | Excel Worksheet Functions | |||
how do i change cell background colour depending on its content? | Excel Discussion (Misc queries) | |||
Changing Colour of Bar depending on Value | Charts and Charting in Excel | |||
changing the colour of cells depending on the content. | Excel Discussion (Misc queries) | |||
Changing cell colour depending on another cells value... | Excel Discussion (Misc queries) |