Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Sheet Checkboxes clear

how do i set a macro to clear checkboxes that are on sheet1 of my workbook.

i would like to do this with a macro because there are about 50 of them.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Sheet Checkboxes clear

Hi Pete,

If the checkboxes are from the Forms Toolbar, then try:

ActiveSheet.CheckBoxes = False

If they are from the Control Toolbox, try:

'=======================
Public Sub Tester01()
Dim sh As Worksheet
Dim oleObj As OLEObject

Set sh = ActiveSheet

For Each oleObj In sh.OLEObjects
If TypeOf oleObj.Object Is MSForms.CheckBox Then
oleObj.Object.Value = False

End If
Next oleObj

End Sub
'<<=======================

---
Regards,
Norman



"Pete" wrote in message
...
how do i set a macro to clear checkboxes that are on sheet1 of my
workbook.

i would like to do this with a macro because there are about 50 of them.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Sheet Checkboxes clear

Thanks Norman - they were from the forms toolbar and
ActiveSheet.CheckBoxes = False
worked

"Norman Jones" wrote in
:

Hi Pete,

If the checkboxes are from the Forms Toolbar, then try:

ActiveSheet.CheckBoxes = False

If they are from the Control Toolbox, try:

'=======================
Public Sub Tester01()
Dim sh As Worksheet
Dim oleObj As OLEObject

Set sh = ActiveSheet

For Each oleObj In sh.OLEObjects
If TypeOf oleObj.Object Is MSForms.CheckBox Then
oleObj.Object.Value = False

End If
Next oleObj

End Sub
'<<=======================

---
Regards,
Norman



"Pete" wrote in message
...
how do i set a macro to clear checkboxes that are on sheet1 of my
workbook.

i would like to do this with a macro because there are about 50 of
them.





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
Clear certain checkboxes Arlen Excel Discussion (Misc queries) 4 May 20th 10 11:42 PM
How to clear all checkboxes on a form? Arlen Excel Worksheet Functions 2 May 6th 10 04:20 PM
Macro to clear checkboxes Guy[_2_] Excel Worksheet Functions 5 January 2nd 09 08:39 PM
Clear Checkboxes fak119 Excel Discussion (Misc queries) 1 March 22nd 07 04:43 PM
Clear All Checkboxes? Brad Excel Programming 3 January 11th 05 07:58 PM


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