Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default VBA

Trying to circumvent the conditional format limit of 3 in Excel 03. I have
a file with various percents and want to color code each percent threshold.
For instance, if it is 60 to 75% color code it 27 (excel color code). This
is what I have, but it is not working ~ hair loss is immenent:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim icolor As Integer

Set MyPage = Range(("$e$2:$bn$63"), "%0")
For Each Cell In MyPage

If Cell.Value = 0 Then
Cell.Interior.ColorIndex = 15
Else
If Cell.Value 76 < 89 Then
Cell.Interior.ColorIndex = 35
Else
If Cell.Value 89 Then
Cell.Interior.ColorIndex = 43
Else
If Cell.Value 60 < 75 Then
Cell.Interior.ColorIndex = 27
Else
If Cell.Value 50 < 60 Then
Cell.Interior.ColorIndex = 45
Else
If Cell.Value 1 < 50 Then
Cell.Interior.ColorIndex = 45
End If

Next
--
Regards
 
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 02:07 AM.

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

About Us

"It's about Microsoft Excel"