Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Forms Option Buttons(Can be right mouse selected when sheet is loc
Hi
I have been using form option buttons rather than the ones from the command toolbox as they have a better appearance on the screen. The option buttons are not locked because I use the macro to clear them all when the sheet gets used again. Private Sub clear_Click() Worksheets("sheet1").CheckBoxes.Value = xlOff Worksheets("sheet1").OptionButtons.Value = xlOff End Sub If I lock the option buttons I get an run time error on running the macro! But if I don't lock the option buttons you can still right mouse and select them, which is also true for the forms checkbox. I like to use the forms option buttons as the sheet gets printed and these buttons look better compared to the option buttons from the command toolbox. Is there a way to modify the macro so that it will work when the option buttons are locked? Hope that makes sense. -- This post was created using recycled electrons! |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Forms Option Buttons(Can be right mouse selected when sheet is loc
I think you have a couple of options.
1. When you protect the worksheet, allow the user (and your code to edit objects). This option is near the bottom of the list in xl2002+. It's a checkbox in earlier versions. 2. Add code that unprotects the worksheet, does the work, reprotects the worksheet. Private Sub clear_Click() dim myPWD as string myPWD = "hi" with worksheets("sheet1") .unprotect password:=myPWD .CheckBoxes.Value = xlOff .OptionButtons.Value = xlOff .protect password:=mypwd end with End Sub Newbeetle wrote: Hi I have been using form option buttons rather than the ones from the command toolbox as they have a better appearance on the screen. The option buttons are not locked because I use the macro to clear them all when the sheet gets used again. Private Sub clear_Click() Worksheets("sheet1").CheckBoxes.Value = xlOff Worksheets("sheet1").OptionButtons.Value = xlOff End Sub If I lock the option buttons I get an run time error on running the macro! But if I don't lock the option buttons you can still right mouse and select them, which is also true for the forms checkbox. I like to use the forms option buttons as the sheet gets printed and these buttons look better compared to the option buttons from the command toolbox. Is there a way to modify the macro so that it will work when the option buttons are locked? Hope that makes sense. -- This post was created using recycled electrons! -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Forms Option Buttons(Can be right mouse selected when sheet is
Cheers Dave,
You have been a life saver this week. -- This post was created using recycled electrons! "Dave Peterson" wrote: I think you have a couple of options. 1. When you protect the worksheet, allow the user (and your code to edit objects). This option is near the bottom of the list in xl2002+. It's a checkbox in earlier versions. 2. Add code that unprotects the worksheet, does the work, reprotects the worksheet. Private Sub clear_Click() dim myPWD as string myPWD = "hi" with worksheets("sheet1") .unprotect password:=myPWD .CheckBoxes.Value = xlOff .OptionButtons.Value = xlOff .protect password:=mypwd end with End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell References | Excel Discussion (Misc queries) | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
Sum up columns in different sheet with error check | Excel Discussion (Misc queries) | |||
Referring to the previous selected sheet in a macro | Excel Discussion (Misc queries) | |||
Copying multiple sheets from one book 2 another and undertake spec | Excel Discussion (Misc queries) |