View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chong Moua Chong Moua is offline
external usenet poster
 
Posts: 22
Default 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.

.