Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checkbox toggle true/false


How can I get a Checkbox to reverese its function.

I have a check box linked to a cell and want the box to be checke
when the cell is False, and clear the cell is True.

Any help appreciated

--
Donki
-----------------------------------------------------------------------
Donkin's Profile: http://www.excelforum.com/member.php...fo&userid=2371
View this thread: http://www.excelforum.com/showthread.php?threadid=37569

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Checkbox toggle true/false

Assuming checkbox is from Forms toolbar, not control toolbox:
Substitute your linked cell's address, the sheet name, and the CheckBox name
in the below:

Sub CheckBox1_Click()

Range(LinkedCell).Value = (Sheets("Sheet1").Shapes("Check Box
1").ControlFormat.Value < 1)

End Sub

If you also need the checkbox to update when the user changes the value in
the linked cell, you would need to do this as well in the Worksheet's code
module:

Private Sub Worksheet_Change(ByVal Target As Range)

Select Case Range(LinkedCell).Value
Case True
Sheets("Sheet1").Shapes("Check Box 1").ControlFormat.Value = -4146
Case False
Sheets("Sheet1").Shapes("Check Box 1").ControlFormat.Value = 1
End Select

End Sub




"Donkin" wrote:


How can I get a Checkbox to reverese its function.

I have a check box linked to a cell and want the box to be checked
when the cell is False, and clear the cell is True.

Any help appreciated.


--
Donkin
------------------------------------------------------------------------
Donkin's Profile: http://www.excelforum.com/member.php...o&userid=23715
View this thread: http://www.excelforum.com/showthread...hreadid=375694


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Checkbox toggle true/false

I'd use a helper cell and a formula that checked that linked cell:

If A1 is the linked cell, then I'd put this in B1:

=not(a1)

Then use B1 for anything that I needed (hide column A if you want).

Donkin wrote:

How can I get a Checkbox to reverese its function.

I have a check box linked to a cell and want the box to be checked
when the cell is False, and clear the cell is True.

Any help appreciated.

--
Donkin
------------------------------------------------------------------------
Donkin's Profile: http://www.excelforum.com/member.php...o&userid=23715
View this thread: http://www.excelforum.com/showthread...hreadid=375694


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checkbox toggle true/false


Thanks Guys but I couldn’t get your suggestions to work but my
solution is:-

Forms Checkbox which is linked to Cell B1

The Checkbox is assigned a Macro which inputs a formula into cell A1

The Macro then inputs an IF function into Cell B1 with
IF(A1=”Formula”,True,False)

If the formula is in A1, B1 returns True which Checks the Checkbox

If the User has inputted a Value in A1, B1 returns False and due to the
IF function Checkbox, unchecks itself.

Thanks for the help


--
Donkin
------------------------------------------------------------------------
Donkin's Profile: http://www.excelforum.com/member.php...o&userid=23715
View this thread: http://www.excelforum.com/showthread...hreadid=375694

Reply
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
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu LunaMoon Excel Discussion (Misc queries) 9 July 29th 08 12:28 AM
I need to create a simple checkbox that has true false outputs RCN Excel Discussion (Misc queries) 1 June 6th 06 08:28 PM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 10:28 AM
True Or False, no matter what... it still displays the false statement rocky640[_2_] Excel Programming 2 May 13th 04 04:57 PM
Toggle True/False in a cell Dave Peterson[_3_] Excel Programming 2 October 10th 03 03:05 AM


All times are GMT +1. The time now is 09:44 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"