Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Changing radio button control

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Changing radio button control

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Changing radio button control

Thanks Merjet.

Works great.

Andrew

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Cell Link on Spin Button Form Control Adam Ronalds Excel Discussion (Misc queries) 14 August 27th 09 05:52 PM
Triggering a macro to run by changing a radio button Modell Excel Programming 2 March 5th 07 12:19 AM
Changing the colour of a control button in Excel Zakynthos Excel Programming 3 February 13th 07 04:26 PM
How do I lock a radio button group if a N/A button is selected worry a lot Excel Discussion (Misc queries) 2 May 21st 05 08:33 PM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"