View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Excel Conditional Formatting

Why would you want to? With calculate, you would need to check each cell,
each value. Not as efficient.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"JDB" wrote in message
oups.com...
I pickedup the following code from
http://www.ozgrid.com/VBA/excel-cond...ting-limit.htm

Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("A1:A10")) is Nothing Then
Select Case Target
Case 1 To 5
icolor = 6
Case 6 To 10
icolor = 12
Case 11 To 15
icolor = 7
Case 16 To 20
icolor = 53
Case 21 To 25
icolor = 15
Case 26 To 30
icolor = 42
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
-------------------
This works real well


How can I make this work with a Worksheet_Calculate subroutine?

I tried to play with it but could not make it work. I have a rather
large range of temperature values I would like to color as I change
different parameters.

Thanks for any help.

JDB