resetting options buttons

R

Rmagic

hello

I have a sheet with a drop down box and some options buttons
the opitions buttons are in group of 2 (yes / no options)

I also have a command button that clears the cells and return you to
the main page but i want to reset the options buttons to no but every
time i try i get a dug error i have try to record one will stop no joy

Code
Range("D9").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=60
Range("C87").Select
ActiveCell.FormulaR1C1 = "1"
Range("C88").Select
ActiveWindow.SmallScroll Down:=-60
Range("D9").Select
OptionButton10.Value = True
OptionButton4.Value = True
OptionButton6.Value = True
Sheets("mainpage").Select

the option buttons are from the control toolbox

Help
Thanks
 
B

Bob Phillips

Try this code

Application.EnableEvents = False
Range("D9").ClearContents
Range("C87").FormulaR1C1 = "1"
ActiveSheet.OLEObjects("OptionButton10").Object.Value = True
ActiveSheet.OLEObjects("OptionButton4").Object.Value = True
ActiveSheet.OLEObjects("OptionButton6").Object.Value = True
Sheets("mainpage").Select
Application.EnableEvents = True


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top