Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
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.

.

Reply
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



All times are GMT +1. The time now is 10:33 AM.

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

About Us

"It's about Microsoft Excel"