Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have created some user forms that gather information into a worksheet. The worksheet has checkboxes that gets set based on the answers from the user form. I used the checkboxes from the control toolbox. I have mutiple checkboxes in some cells. Question: How can I loop through the checkboxes in the worksheet and set the enable property to false. I know how you can do this on a user form with controls but not sure how on a worksheet. Thanks in advance for any help! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Sub test2() For Each obj In ActiveSheet.OLEObjects If TypeOf obj.Object Is MSForms.CheckBox Then obj.Object.Value = True End If Next End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "bman" wrote in message ... I have created some user forms that gather information into a worksheet. The worksheet has checkboxes that gets set based on the answers from the user form. I used the checkboxes from the control toolbox. I have mutiple checkboxes in some cells. Question: How can I loop through the checkboxes in the worksheet and set the enable property to false. I know how you can do this on a user form with controls but not sure how on a worksheet. Thanks in advance for any help! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops
Change it to False -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Ron de Bruin" wrote in message ... Try this Sub test2() For Each obj In ActiveSheet.OLEObjects If TypeOf obj.Object Is MSForms.CheckBox Then obj.Object.Value = True End If Next End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "bman" wrote in message ... I have created some user forms that gather information into a worksheet. The worksheet has checkboxes that gets set based on the answers from the user form. I used the checkboxes from the control toolbox. I have mutiple checkboxes in some cells. Question: How can I loop through the checkboxes in the worksheet and set the enable property to false. I know how you can do this on a user form with controls but not sure how on a worksheet. Thanks in advance for any help! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks for the info. I just made a few changes to accomodate the enabl part. Sub test2() Dim mycheck As MSForms.CheckBox For Each obj In ActiveSheet.OLEObjects If TypeOf obj.Object Is MSForms.CheckBox Then Set mycheck = obj.Object mycheck.Enabled = False End If Next End Sub Appreciate your help ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
checkbox in a protected worksheet | Excel Worksheet Functions | |||
checkbox and worksheet | Excel Discussion (Misc queries) | |||
How? Macro to copy range to new worksheet, name new worksheet, loop | Excel Programming | |||
For loop for Checkbox | Excel Programming | |||
For loop for Checkbox | Excel Programming |