View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
Dave Mills Dave Mills is offline
external usenet poster
 
Posts: 3
Default What's the best way to toggle between true and false in Excel? Hi

What keyboard shortcut can be any faster that holding Shift and right clicking
the mouse.

On Mon, 28 Jul 2008 11:19:17 -0700 (PDT), LunaMoon
wrote:

On Jul 28, 1:28*am, Greg Wilson
wrote:
One way is this:

1. *In a *standard* module paste:
Declare Function GetKeyState Lib "User32.dll" (ByVal NVirtKey As Long) As
Integer

2. *In the worksheet's class module paste this:
Const VK_SHIFT = &H10

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Dim c As Range
If GetKeyState(VK_SHIFT) < 0 Then
* * Cancel = True
* * For Each c In Selection.Cells
* * * * If VarType(c.Value) = vbBoolean Then
* * * * * * c.Value = Not c.Value
* * * * End If
* * Next
* * Set c = Nothing
End If
End Sub

3. *Select the cells and hold down the Shift key when right clicking to
toggle the boolean values.

Greg

"LunaMoon" wrote:
What's the best way to toggle between true and false in Excel?


Hi all,


My excel work involves a lot of toggling between true and false
(boolean types) ... and it's very repetitive...


Is there a way to select a bunch of cells, and press a key short-cut
so that they toggle all at once?


Thanks!


Thanks! Any pure key short-cut solution?
I think that's the fastest...

--
Dave Mills
There are 10 type of people, those that understand binary and those that don't.