PC Review


Reply
Thread Tools Rate Thread

Changing radio button control

 
 
Andreww
Guest
Posts: n/a
 
      20th Mar 2007
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

 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      20th Mar 2007
> 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



 
Reply With Quote
 
Andreww
Guest
Posts: n/a
 
      20th Mar 2007
Thanks Merjet.

Works great.

Andrew

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WPF - Changing Radio Button to have Command Button Style??? samadams_2006@yahoo.ca Microsoft C# .NET 1 7th Feb 2009 04:17 PM
Triggering a macro to run by changing a radio button =?Utf-8?B?TW9kZWxs?= Microsoft Excel Programming 2 5th Mar 2007 12:19 AM
Radio Button Custom Control not grouping... Tim Microsoft C# .NET 0 25th Aug 2005 02:18 PM
ASP .net bug when changing stae of radio button..? Carlos Microsoft ASP .NET 2 16th Feb 2005 06:47 PM
Radio button control ... Joe Best Microsoft Access Form Coding 0 14th May 2004 10:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:13 AM.