Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Reset Checkboxes from Control Tool Box

Norman provided the following code which resets the checkboxes from the Forms
Toolbar. Can someone amend this for me to apply to checkboxes from the
Control Tool Box

Public Sub Tester()
ActiveSheet.CheckBoxes.Value = xlOff
End Sub

Thank you
--
Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Reset Checkboxes from Control Tool Box

Hi Robert,

Try:

'=============
Public Sub Tester()
Dim obj As OLEObject

For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MsForms.CheckBox Then
obj.Object.Value = False
End If
Next obj

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


---
Regards,
Norman



"Robert" wrote in message
...
Norman provided the following code which resets the checkboxes from the
Forms
Toolbar. Can someone amend this for me to apply to checkboxes from the
Control Tool Box

Public Sub Tester()
ActiveSheet.CheckBoxes.Value = xlOff
End Sub

Thank you
--
Robert



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Reset Checkboxes from Control Tool Box

Thank you Norman,
--
Robert



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Reset Checkboxes from Control Tool Box

Hi, Norman, I had attached macros to the CheckBoxes. When the Reset
Macro is executed, the individual macros attached to the CheckBoxes are being
activated aswell. Is there a way to prevent the underlying macros from being
executed.
Thank you.
--
Robert



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Reset Checkboxes from Control Tool Box

Hi Robert,

Hi, Norman, I had attached macros to the CheckBoxes. When the Reset
Macro is executed, the individual macros attached to the CheckBoxes are
being
activated aswell. Is there a way to prevent the underlying macros from
being
executed.


Try:

'=============
Public Sub Tester()
Dim obj As OLEObject
Dim Cbox As MsForms.CheckBox

Application.EnableEvents = False
For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MsForms.CheckBox Then
obj.Object.Value = False
End If
Next obj
Application.EnableEvents = True
End Sub
'<<=============


---
Regards,
Norman




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Reset Checkboxes from Control Tool Box

No luck, Norman, problem persists. Any further response
will be followed up by me in 14 hours time. Anyway, thank you
for your effort. I shall continue to look out.
--
Robert


"
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Reset Checkboxes from Control Tool Box

Try something like this:

'at the top of the General module

Option explicit
Public BlkProc as boolean

Public Sub Tester()
Dim obj As OLEObject
Dim Cbox As MsForms.CheckBox

blkproc = true
For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MsForms.CheckBox Then
obj.Object.Value = False
End If
Next obj
blkproc = false
End Sub

Then for each checkbox, you'll have to check the status of the boolean.

Private Sub CheckBox1_Click()

if blkproc = true then exit sub

'rest of your code here

End Sub




Robert wrote:

Hi, Norman, I had attached macros to the CheckBoxes. When the Reset
Macro is executed, the individual macros attached to the CheckBoxes are being
activated aswell. Is there a way to prevent the underlying macros from being
executed.
Thank you.
--
Robert


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Reset Checkboxes from Control Tool Box

Yes,Yes,Yes that did it. Thank you Dave.
Thanks to Norman too.
--
Robert



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
How do I add a control check box to control other checkboxes? JGarland Excel Worksheet Functions 1 September 18th 08 12:26 PM
CheckBoxes: How to reset Rob Excel Discussion (Misc queries) 9 September 8th 06 04:25 AM
creating checkboxes from forms tool bar KB Excel Worksheet Functions 2 April 25th 06 03:53 AM
Tool Tip Text for Form control/ Active-X control Freddie[_2_] Excel Programming 0 October 19th 04 04:14 AM
Forms control checkboxes on charts routeram Excel Programming 1 September 13th 04 12:38 AM


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