View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JDB[_2_] JDB[_2_] is offline
external usenet poster
 
Posts: 15
Default Excel Conditional Formatting

Thanks your good advice.
I simply wrote a macro that runs from a command button to run the
conditional formatting code in question. 18,000 cell in about 4 sec,
so I can handle that.

JDB

For the record and anyone else looking at this, I am a hacker, but this
works for me.
-------------------------------
Private Sub CommandButton1_Click()
Call ConditionalFormat
End Sub


Private Sub ConditionalFormat()
Dim icolor As Integer
Dim R As Integer
Dim C As Integer

RangeName = "DataMatrix"

FCol = Range(RangeName).Column
FRow = Range(RangeName).Row

For R = FRow To 3200 Step 1
If Cells(R, FCol) = "" Then
Exit For
End If
For C = FCol To 64 Step 1
If Cells(R, C) = "" Then
Exit For
End If
TargetCell = Round(Cells(R, C), 0)

Select Case TargetCell
Case 0 To 28
icolor = 37
Case 29 To 60
icolor = 41
Case 61 To 90
icolor = 39
Case 91 To 120
icolor = 43
Case 121 To 150
icolor = 6
Case 151 To 180
icolor = 46
Case Else
icolor = 3
End Select

Cells(R, C).Interior.ColorIndex = icolor

Next C
Next R

End Sub
-----------------------------------------------






Bob Phillips wrote:
With Calculate, you will get 18,000 recalculating for every cell change. It
can only be slower.

--

HTH

Bob Phillips