Changing radio button control

A

Andreww

Hi - I have two radio buttons the code for which sits in the sheets
"code area" (as opposed to module'n'. The two buttons are linked such
that only one can be "filled in",

I am trying to trap an error that occurs later on when one of the
radio buttons is clicked and under certain conditions. Rather than
the 2nd radio button being "filled in" I wan the existing button keeps
it's "filled in" value.

I have created code which changes the values of the buttons to what I
want them to be when the error occurs.

My problem is that as the code is on the worksheet code area, I can't
see how the code can be called from my module1 procedure???

The code is:

'1st button is clicked and it does.. things
Private Sub OptionButton1_Click()
'Sheets("admin").Select
Range("A1").Value = 1
'Sheets("Detail").Select

' Module 1 code that does a pile of things
Call make_formula
End Sub

' Changes values of buttons
Sub reset_buttons_on_error()
OptionButton2.Value = False
OptionButton1.Value = True
End Sub

'What happens when 2nd button is clicked
Private Sub OptionButton2_Click()
'Sheets("admin").Select
Range("A1").Value = 2
'Sheets("Detail").Select
Call make_formula
End Sub

I am sure this is basic stuff but I can't see how to do it.

Thanks

Andrew
 
M

merjet

My problem is that as the code is on the worksheet code area, I can't
see how the code can be called from my module1 procedure???

Do you mean reset_buttons_on_error()?

If yes, qualify like this:

Sheets("Sheet1").reset_buttons_on_error

Hth,
Merjet
 

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