View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
Ken Wright Ken Wright is offline
external usenet poster
 
Posts: 634
Default 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 shor

Then you will need to use code. You could still use the range name idea and
then simply assign a bit of code to a keyboard shortcut, eg CTRL+SHIFT+T

Sub Toggle()
Dim Cel As Range
For Each Cel In Range("ToggleVals")
Cel.Value = Not Cel.Value
Next
End Sub

Hit the key combo and you'll change TRUE to FALSE and vice versa. Even
gives you the option of running with mixed values if you had to. If you add
or delete cells to your range of booleans, then all you need do is reset
your named range and no need to touch the code again.

Could also throw a button on and use that, but again just another option.

Regards
Ken................

"LunaMoon" wrote in message
...
On Jul 28, 1:58 pm, "Ken Wright"
wrote:
For a non code solution, simply select all the cells that will be toggled
and then firstly give them a name using Insert / Name / Define and call it
anything you like. That lets you select them all in one easy hit using the
drop down just above cell A1.

Next, simply type TRUE/FALSE or 1/0 depending on what you are using and
then
hit CTRL+ENTER which will put the same value into every cell.

Regards
Ken.......................

"LunaMoon" wrote in message

...

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 but this is not a toggle solution...