nousername
03-19-2008, 05:40 PM
The code below works great at the individual sheet level, but I want it to work at the entire workbook level (ThisWorkBook).
I tried to change the code to use the WorkbookEvents_SheetBeforeDoubleClickEventHandler, but this failed.
How can this code be extended to work at the workbook level?
' Code at the worksheet level
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A:F")) Is Nothing Then
With Target
If Target.Interior.ColorIndex = 6 And Target.Font.Bold Then
Target.EntireRow.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Font.Bold = False
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
Thanks in advance for any support.
I tried to change the code to use the WorkbookEvents_SheetBeforeDoubleClickEventHandler, but this failed.
How can this code be extended to work at the workbook level?
' Code at the worksheet level
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A:F")) Is Nothing Then
With Target
If Target.Interior.ColorIndex = 6 And Target.Font.Bold Then
Target.EntireRow.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Font.Bold = False
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
Thanks in advance for any support.