excel怎樣快捷鍵標紅
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error GoTo 100
If Not Application.Intersect(Target, Range("G2:O50000")) Is Nothing And Target.Count = 1 Then
If Val(Trim(Target)) = 0 Then
MsgBox "該項資料,不能!"
Cancel = True
Exit Sub
End If
If Target.Interior.ColorIndex = 3 Then
If MsgBox("本單元據已標紅,是否取消標紅?", vbYesNo) = vbYes Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 3
100
End Sub
excel怎樣快捷鍵標紅
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error GoTo 100
If Not Application.Intersect(Target, Range("G2:O50000")) Is Nothing And Target.Count = 1 Then
If Val(Trim(Target)) = 0 Then
MsgBox "該項資料,不能!"
Cancel = True
Exit Sub
End If
If Target.Interior.ColorIndex = 3 Then
If MsgBox("本單元據已標紅,是否取消標紅?", vbYesNo) = vbYes Then
Target.Interior.ColorIndex = 0
End If
Else
Target.Interior.ColorIndex = 3
End If
End If
Cancel = True
100
End Sub