Here is one way to do that. Replace the code I posted earlier with the all
the code I have marked below instead. To activate/deactivate the crosshair
mode, just double click any cell on the worksheet... if the crosshair is
visible, it will be turned off... if the crosshair is not visible, it will
be turned on.
'*************** START OF CODE ***************
Dim CrosshairModeOn As Boolean
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
Cancel = True
CrosshairModeOn = Not CrosshairModeOn
If CrosshairModeOn Then
Union(Target.EntireColumn, Target.EntireRow).Interior.ColorIndex = 15
Else
Cells.Interior.ColorIndex = 0
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If CrosshairModeOn Then
Cells.Interior.ColorIndex = 0
Union(Target.EntireColumn, Target.EntireRow).Interior.ColorIndex = 15
End If
End Sub
'*************** END OF CODE ***************
--
Rick (MVP - Excel)
"Max" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Rick, Thanks for sharing your crosshair sub. Is there a way in which we
> can control that worksheet sub's activation/deactivation via say, another
> sub assigned to a button? This is meant to enable "normal" mode (ie with
> crosshair sub deactivated) so that we can work on the sheet as per normal,
> with undo available, and switch-over to activate the crosshair sub
> whenever required. Thanks
>
>
|