A
andre.roukema
If you hold the control-key when you select a cell, then one area will be added to the current selection even if you control-click on the activecell.
This behaviour can be used to do something cool: ctrl-click on a cell to flip TRUE and FALSE. You can use the SheetSelectionChange event of the workbook to accomplish this.
Here is the code to insert in the code module of the workbook:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Areas.Count = 2 Then
If Target.Areas(2).Cells.Count = 1 Then
If TypeName(Target.Areas(2).Value) = "Boolean" Then
Target.Areas(2).Value = Not Target.Areas(2).Value
Target.Areas(2).Select
End If
End If
End If
End Sub
This behaviour can be used to do something cool: ctrl-click on a cell to flip TRUE and FALSE. You can use the SheetSelectionChange event of the workbook to accomplish this.
Here is the code to insert in the code module of the workbook:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Areas.Count = 2 Then
If Target.Areas(2).Cells.Count = 1 Then
If TypeName(Target.Areas(2).Value) = "Boolean" Then
Target.Areas(2).Value = Not Target.Areas(2).Value
Target.Areas(2).Select
End If
End If
End If
End Sub