When I insert that command, I get the error: Compile error: proceedure
declaration does not match description of event or proceedure having the same
name.
Private Sub Worksheet_Calculate(ByVal Target As Range)
With Target(1)
If Not Intersect(.Cells, Range("A1:M99")) Is Nothing Then
..Font.ColorIndex = xlColorIndexAutomatic
Select Case Application.Round(.Value, 2)
Case Is < 0
..Interior.ColorIndex = xlNone
Case Is < 1.1
..Interior.ColorIndex = 3
Case Is < 2.5
..Interior.ColorIndex = 6
Case Is < 3.5
..Interior.ColorIndex = 4
Case Is <= 4#
..Interior.ColorIndex = 5
..Font.ColorIndex = 2
Case Else
..Interior.ColorIndex = xlColorIndexNone
End Select
End If
End With
End Sub
"JE McGimpsey" wrote:
It's not a problem with the macro - a Worksheet_Change event fires when
the user (or an external source) makes an entry, not when a value
changes due to a calculation.
If you want colors to change automatically when a calculation occurs,
use the _Calculate() event instead.
In article ,
"Brian in FT W." wrote:
Another problem with this macro. I have several people reviewing data, each
person has a tab that flows into a summation tab. The tabs where people enter
their information change color automatically. On the summation tab, you have
to hit enter 2x or F2 to activate the color. Any way to get around this?
|