|
楼主 |
发表于 2014-11-22 13:30
|
显示全部楼层
本帖最后由 jessylake 于 2014-11-22 13:49 编辑
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Row > 2 And (Target.Column = 2 Or Target.Column = 4 Or Target.Column = 6) Then
- Set rg = Union(Cells(Target.Row, 2), Cells(Target.Row, 4), Cells(Target.Row, 6))
- rg.Interior.ColorIndex = 2
- rg.Font.ColorIndex = 1
- For Each Rng In rg
- If Rng = Application.Max(rg) Then
- Rng.Interior.ColorIndex = 3
- Rng.Font.ColorIndex = 2
- ElseIf Rng = Application.Min(rg) Then
- Rng.Interior.ColorIndex = 10
- Rng.Font.ColorIndex = 2
- End If
- Next
- End If
- End Sub
复制代码 |
|