- 帖子
- 65
- 主題
- 0
- 精華
- 0
- 積分
- 120
- 點名
- 0
- 作業系統
- Win 7
- 軟體版本
- Office 2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2010-5-15
- 最後登錄
- 2010-7-16
|
回復 5# PD961A
小弟我用比較笨的作法,不過呢是可以達到您要的效果就是了
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For Each a In Range(Me.[a2], Me.[h17])
Select Case a
Case Me.[a1]
a.Interior.ColorIndex = 3
Case Me.[b1]
a.Interior.ColorIndex = 4
Case Me.[c1]
a.Interior.ColorIndex = 5
Case Me.[d1]
a.Interior.ColorIndex = 6
Case Me.[e1]
a.Interior.ColorIndex = 7
Case Me.[f1]
a.Interior.ColorIndex = 8
Case Me.[g1]
a.Interior.ColorIndex = 9
Case Me.[h1]
a.Interior.ColorIndex = 10
Case Else
a.Interior.Pattern = xlNone
End Select
Next
End Sub |
|