ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please somebody help me... (https://www.excelbanter.com/excel-programming/271359-please-somebody-help-me.html)

Jason[_15_]

Please somebody help me...
 
Hello. I am needing to do a conditional statement which
changes the cell shading. I've found Format/Conditional
Formatting, but I can only nest 3 levels down. I need to
nest 4 levels. If a, make cell shading red, b = blue, c
= yellow, and d = red. By default it needs to be none.
Can anyone offer a suggestion to help? I think I need to
use Functions, I can do an If then, but need to know how
to change the cell shading. TIA!!!!!!! Much appreciated.


Bob Phillips[_5_]

Please somebody help me...
 
Guess what, it's still no, 3 is the max.

--

HTH

Bob Phillips

"Jason" wrote in message
...
Hello. I am needing to do a conditional statement which
changes the cell shading. I've found Format/Conditional
Formatting, but I can only nest 3 levels down. I need to
nest 4 levels. If a, make cell shading red, b = blue, c
= yellow, and d = red. By default it needs to be none.
Can anyone offer a suggestion to help? I think I need to
use Functions, I can do an If then, but need to know how
to change the cell shading. TIA!!!!!!! Much appreciated.




Chong Moua

Please somebody help me...
 
Hi Jason,

Try this...
-----------------------------------
Sub color()

Dim i As Integer

For i = 1 To ActiveSheet.UsedRange.Rows.Count
If Cells(i, "A") = "a" Then Cells
(i, "A").Interior.ColorIndex = 3
If Cells(i, "A") = "b" Then Cells
(i, "A").Interior.ColorIndex = 5
If Cells(i, "A") = "c" Then Cells
(i, "A").Interior.ColorIndex = 6
If Cells(i, "A") = "d" Then Cells
(i, "A").Interior.ColorIndex = 10
Next i

End Sub
-----------------------------
Hope this helps...

Chong Moua

-----Original Message-----
Hello. I am needing to do a conditional statement which
changes the cell shading. I've found Format/Conditional
Formatting, but I can only nest 3 levels down. I need to
nest 4 levels. If a, make cell shading red, b = blue, c
= yellow, and d = red. By default it needs to be none.
Can anyone offer a suggestion to help? I think I need to
use Functions, I can do an If then, but need to know how
to change the cell shading. TIA!!!!!!! Much appreciated.

.



All times are GMT +1. The time now is 11:06 AM.

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