Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi,
can anybody explain to me what does "not" do in the following code: With Sheets("Sheet1").OptionButton1 'code name for the button .Value = Not .Value End With thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The optionbutton's value can be true or false.
Not true = false not false = true The code toggles the optionbutton from checked to unchecked or vice versa. peyman wrote: hi, can anybody explain to me what does "not" do in the following code: With Sheets("Sheet1").OptionButton1 'code name for the button .Value = Not .Value End With thanks -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
thanx I got it.
"Dave Peterson" wrote: The optionbutton's value can be true or false. Not true = false not false = true The code toggles the optionbutton from checked to unchecked or vice versa. peyman wrote: hi, can anybody explain to me what does "not" do in the following code: With Sheets("Sheet1").OptionButton1 'code name for the button .Value = Not .Value End With thanks -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The "Not" operator flips the bits, changing a 0 bit to a 1 bit. Generally,
you would use this only with TRUE and FALSE values to toggle between the two (TRUE = NOT FALSE, FALSE = NOT TRUE), but it can be used with any number. E.g., Not &h000000FF = &hFFFFFF00 If it is used with number other than -1 (TRUE) and 0 (FALSE), it would be confusing and quite possibly wrong. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "peyman" wrote in message ... hi, can anybody explain to me what does "not" do in the following code: With Sheets("Sheet1").OptionButton1 'code name for the button .Value = Not .Value End With thanks |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
thank you for your explanation.
"Chip Pearson" wrote: The "Not" operator flips the bits, changing a 0 bit to a 1 bit. Generally, you would use this only with TRUE and FALSE values to toggle between the two (TRUE = NOT FALSE, FALSE = NOT TRUE), but it can be used with any number. E.g., Not &h000000FF = &hFFFFFF00 If it is used with number other than -1 (TRUE) and 0 (FALSE), it would be confusing and quite possibly wrong. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "peyman" wrote in message ... hi, can anybody explain to me what does "not" do in the following code: With Sheets("Sheet1").OptionButton1 'code name for the button .Value = Not .Value End With thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Codes | Excel Discussion (Misc queries) | |||
VB Codes | Excel Discussion (Misc queries) | |||
Need some macro codes | Excel Discussion (Misc queries) | |||
codes, codes, codes... | Excel Discussion (Misc queries) | |||
hiding macro codes upon protecting the worksheet | Excel Discussion (Misc queries) |