Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Toggle Button | Excel Worksheet Functions | |||
Need to Use 1 Button to toggle On or Off | Excel Discussion (Misc queries) | |||
Toggle Button | Excel Programming | |||
Adding .xla button for Toggle Calculation Button | Excel Programming | |||
Toggle Button | Excel Programming |