Article ID: 142154
Article Last Modified on 8/17/2005
=SUM(A1:A10)
Sub auto_open()
' Run the macro DidCellsChange any time a entry is made in a
' cell in Sheet1.
ThisWorkbook.Worksheets("Sheet1").OnEntry = "DidCellsChange"
End Sub
Sub DidCellsChange()
Dim KeyCells as String
' Define which cells should trigger the KeyCellsChanged macro.
KeyCells = "A1:A10, B1:B10, C1:C10"
' If the Activecell is one of the key cells, call the
' KeyCellsChanged macro.
If Not Application.Intersect(ActiveCell, Range(KeyCells)) _
Is Nothing Then KeyCellsChanged
End Sub
Sub KeyCellsChanged()
Dim Cell as Object
' If the values in A11:C11 are greater than 50...
For Each Cell In Range("A11:C11")
If Cell > 50 Then
' Make the background color of the cell the 3rd color on the
' current palette.
Cell.Interior.ColorIndex = 3
Else
' Otherwise, set the background to none (default).
Cell.Interior.ColorIndex = xlNone
End If
Next Cell
End Subprocedures, running
Additional query words: 5.00a 5.00c 8.00 xl97
Keywords: kbhowto kbprogramming kbdtacode KB142154