LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How do I toggle a button across a range of columns

Hi Sodaboy,

It works a treat. Just so I know whats going on here, please could you
briefly explain how the 'NOT' function is evaluated.



Me.Columns("N:V").Hidden = _
Not (Me.Columns("N:V").Hidden = True)


In the right-hand side of this equation, the expression:
Me.Columns("N:V").Hidden = True
returns a Boolean True or False value according to the visible state of
columns N:V.

The Not operator serves to reverse (or negate) the returned Boolean value.
So the not operator is here used to toggle the visibility of the column
range by setting its hidden property to the reverse of the returned value.

The Not equality expression is a shorter, more elegant way of expressing the
following, equivalent If,,,Then,,,Else construct:

If Me.Columns("N:V").Hidden = True Then
Me.Columns("N:V").Hidden = False
ElseIf Me.Columns("N:V").Hidden = False Then
Me.Columns("N:V").Hidden = True
End If

See also the examples in VBA help under 'Not Operator'

---
Regards,
Norman


"sodaboy" wrote in
message ...

Thanks Norman,

It works a treat. Just so I know whats going on here, please could you
briefly explain how the 'NOT' function is evaluated.

Thanks again


--
sodaboy
------------------------------------------------------------------------
sodaboy's Profile:
http://www.excelforum.com/member.php...o&userid=27467
View this thread: http://www.excelforum.com/showthread...hreadid=469807



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toggle Button Squeaky Excel Worksheet Functions 0 September 17th 08 04:14 PM
Need to Use 1 Button to toggle On or Off Jim May Excel Discussion (Misc queries) 2 December 1st 07 08:01 PM
Toggle Button Dave_2k5[_7_] Excel Programming 4 September 1st 05 10:55 AM
Adding .xla button for Toggle Calculation Button Mike Excel Programming 5 August 19th 05 01:55 PM
Toggle Button Keri[_2_] Excel Programming 2 May 28th 04 04:58 PM


All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"