ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set Color of Cell Background Based on value in another cell (https://www.excelbanter.com/excel-programming/344050-set-color-cell-background-based-value-another-cell.html)

ski2004_2005[_2_]

Set Color of Cell Background Based on value in another cell
 

Set Color of Cell Background Based on value in another cell::

Hi,
Here is my example. I need to set the fill background of cell b4 based
on the value that it is c4. Obviously you can't do this using
conditional formatting because it would only work for c4. It looks
like this:

b4 - blank cell
c4 - "complete"

I need b4 to be green if c4 = complete and i need it to be red if the
cell is equal to something else.

Thanks


--
ski2004_2005
------------------------------------------------------------------------
ski2004_2005's Profile: http://www.excelforum.com/member.php...o&userid=16418
View this thread: http://www.excelforum.com/showthread...hreadid=479942


JE McGimpsey

Set Color of Cell Background Based on value in another cell
 
Sometimes what is obvious is wrong.

With B4 selected, format the background color as red and choose
Format/Conditional Formatting...

CF1: Formula is =C4="complete"
Format1: Patterns/<green

In article ,
ski2004_2005
wrote:

Set Color of Cell Background Based on value in another cell::

Hi,
Here is my example. I need to set the fill background of cell b4 based
on the value that it is c4. Obviously you can't do this using
conditional formatting because it would only work for c4. It looks
like this:

b4 - blank cell
c4 - "complete"

I need b4 to be green if c4 = complete and i need it to be red if the
cell is equal to something else.


Gary Keramidas

Set Color of Cell Background Based on value in another cell
 
if b4 = complete, c4's background will be green

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("B4")
If UCase(Range("C4").Value) = "COMPLETE" Then

.Interior.ColorIndex = 35
Else
.Interior.ColorIndex = 0

End If
End With
End Sub

--


Gary


"ski2004_2005"
wrote in message
news:ski2004_2005.1xkwyc_1130447121.5288@excelforu m-nospam.com...

Set Color of Cell Background Based on value in another cell::

Hi,
Here is my example. I need to set the fill background of cell b4 based
on the value that it is c4. Obviously you can't do this using
conditional formatting because it would only work for c4. It looks
like this:

b4 - blank cell
c4 - "complete"

I need b4 to be green if c4 = complete and i need it to be red if the
cell is equal to something else.

Thanks


--
ski2004_2005
------------------------------------------------------------------------
ski2004_2005's Profile:
http://www.excelforum.com/member.php...o&userid=16418
View this thread: http://www.excelforum.com/showthread...hreadid=479942





All times are GMT +1. The time now is 08:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com