- 帖子
- 154
- 主題
- 1
- 精華
- 0
- 積分
- 200
- 點名
- 1
- 作業系統
- windwos 7
- 軟體版本
- 64bit
- 閱讀權限
- 20
- 註冊時間
- 2017-5-29
- 最後登錄
- 2025-1-1
|
7#
發表於 2021-9-5 20:56
| 只看該作者
本帖最後由 quickfixer 於 2021-9-5 20:57 編輯
回復 6# av8d
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim xA As Range, xR As Range
Cells.Interior.Pattern = 0
If Target.Column = 3 Then
Set xA = [A4:G1000]
If Intersect(xA, Target) Is Nothing Then Exit Sub
For Each xR In xA.Rows
If Not Intersect(xR, Target) Is Nothing Then
If Cells(xR.Row, 3) <> "" Then
xR.Interior.Color = RGB(240, 255, 240)
Else
Cells(xR.Row, 3).Interior.Color = RGB(200, 200, 240)
End If
End If
Next
End If
End Sub |
|