- 帖子
- 32
- 主題
- 6
- 精華
- 0
- 積分
- 41
- 點名
- 0
- 作業系統
- WIN10
- 軟體版本
- office2010
- 閱讀權限
- 10
- 性別
- 男
- 來自
- 澳門
- 註冊時間
- 2016-11-29
- 最後登錄
- 2021-5-17
 
|
excel聚光灯怎樣不影響原來格式上的顏色
- Private Sub CheckBox1_Click()
- If CheckBox1.Value = False Then
- CheckBox1.Caption = "關"
- ActiveSheet.Cells.Interior.ColorIndex = xlNone
- Else: CheckBox1.Caption = "開"
- End If
- End Sub
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- If CheckBox1.Caption = "開" Then Call Spotlight(Target)
- End Sub
- Sub Spotlight(ByVal Target As Excel.Range)
- On Error Resume Next
- Cells.FormatConditions.Delete
- With Target.EntireColumn
- .FormatConditions.Add xlExpression, , "=true"
- .FormatConditions(1).Interior.ColorIndex = 20
- End With
- With Target.EntireRow
- .FormatConditions.Add xlExpression, , "=true"
- .FormatConditions(2).Interior.ColorIndex = 20
- End With
-
- End Sub
複製代碼 怎樣解決關掉之後可以刪除聚光燈 |
|