A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Initiate a trigger for clearing a list of check boxes?



 
 
Thread Tools Display Modes
  #1  
Old September 18th, 2008, 03:52 PM posted to microsoft.public.excel.worksheet.functions
JGarland
external usenet poster
 
Posts: 2
Default Initiate a trigger for clearing a list of check boxes?

I have a spreadsheet with a column of check boxes and I want to establish a
trigger to either check or uncheck all boxes at one time.
  #2  
Old September 18th, 2008, 04:36 PM posted to microsoft.public.excel.worksheet.functions
Joel
external usenet poster
 
Posts: 2,855
Default Initiate a trigger for clearing a list of check boxes?

You can use two contol buttons to run the code below. One control button
with the value in the code to true and the other to false


Private Sub CommandButton1_Click()
'Set checkboxes to false
For Each shp In ActiveSheet.Shapes
If shp.OLEFormat.progID = "Forms.CheckBox.1" Then
Set chkbox = ActiveSheet.OLEObjects(shp.Name).Object
chkbox.Value = False
End If
Next
End Sub
Private Sub CommandButton2_Click()
'Set checkboxes true
For Each shp In ActiveSheet.Shapes
If shp.OLEFormat.progID = "Forms.CheckBox.1" Then
Set chkbox = ActiveSheet.OLEObjects(shp.Name).Object
chkbox.Value = True
End If
Next
End Sub

"JGarland" wrote:

I have a spreadsheet with a column of check boxes and I want to establish a
trigger to either check or uncheck all boxes at one time.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.