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


I have a sheet with checkboxes that were placed from the contro
toolbox. Is there a way to clear all the checkboxes on the sheet usin
a command button

Thank

--
gotgame031
-----------------------------------------------------------------------
gotgame0314's Profile: http://www.excelforum.com/member.php...fo&userid=2937
View this thread: http://www.excelforum.com/showthread.php?threadid=49081

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Excel Checkbox Clearing

Hi GotGame,

Try assigning the following code to the command button:

'=============
Sub Tester01()
Dim Ctl As OLEObject

For Each Ctl In Worksheets("Sheet1").OLEObjects
If TypeOf Ctl.Object Is MSForms.CheckBox Then
Ctl.Object.Value = False
End If
Next Ctl
End Sub
'<<=============


---
Regards,
Norman



"gotgame0314"
wrote in message
...

I have a sheet with checkboxes that were placed from the control
toolbox. Is there a way to clear all the checkboxes on the sheet using
a command button

Thanks


--
gotgame0314
------------------------------------------------------------------------
gotgame0314's Profile:
http://www.excelforum.com/member.php...o&userid=29373
View this thread: http://www.excelforum.com/showthread...hreadid=490811



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Excel Checkbox Clearing

Or just use it as:

Sub CommandButton1_Click()
(still under that same worksheet)


Norman Jones wrote:

Hi GotGame,

Try assigning the following code to the command button:

'=============
Sub Tester01()
Dim Ctl As OLEObject

For Each Ctl In Worksheets("Sheet1").OLEObjects
If TypeOf Ctl.Object Is MSForms.CheckBox Then
Ctl.Object.Value = False
End If
Next Ctl
End Sub
'<<=============

---
Regards,
Norman

"gotgame0314"
wrote in message
...

I have a sheet with checkboxes that were placed from the control
toolbox. Is there a way to clear all the checkboxes on the sheet using
a command button

Thanks


--
gotgame0314
------------------------------------------------------------------------
gotgame0314's Profile:
http://www.excelforum.com/member.php...o&userid=29373
View this thread: http://www.excelforum.com/showthread...hreadid=490811


--

Dave Peterson
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
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
Clearing numbers in excel Kevin W[_2_] Excel Discussion (Misc queries) 3 September 9th 08 02:43 PM
Code question for clearing a command checkbox. Newbeetle Excel Discussion (Misc queries) 4 February 13th 07 09:05 AM
checkbox on form reset from checkbox on sheet raw[_12_] Excel Programming 1 December 3rd 05 05:08 AM
Clearing Checkbox Jim May Excel Programming 5 September 25th 05 01:06 PM


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