LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Option Button Macro (Forms Toolbar)

[XL2002 and soon XL2003 on Win2000SP2]

I require some assistance with a macro I have attempted to write to
unhide certain rows when one of three option buttons (OB) is selected.
Where I am running into problems is trying to logically determine the
code necessary to add when I have added additional groups of OB as well
as what happens/needs to happen once the rows are unhidden.

Specifically, my form is comprised of 2 sections; the 1st section is
composed of 6 groups of 3 option buttons (each group of OB corresponds
to one column of data (choices are Canada/US/Other). When a user selects
the Other option, a range of rows is unhidden underneath the 1st section
the for the user to key foreign exchange rates (note that once the user
has at least one Other OB selected, the same rows will apply to all 6
columns). The 2nd section is just a duplicate of the first allowing the
user a total of 12 possible items to key. All groups are functioning
independently and working well. My macro works great for the first set
of OB (posted below WITH confusing issues commented out) but I an
confused as to the following:

----------------------------------------------------
Sub OptionButtonItem1to6_Click()
With Sheet4.DrawingObjects("Option Button 163")
If Sheet4.DrawingObjects("Option Button 163").Value = 1 Then
Range("INTL_FX_1to6").EntireRow.Hidden = False
Else
Range("INTL_FX_1to6").EntireRow.Hidden = True
'If Sheet4.DrawingObjects("Option Button 161").Value = 1 Then
' Range("INTL_FX_1to6").EntireRow.Hidden = True
' ElseIf Sheet4.DrawingObjects("Option Button 162").Value = 2 Then
' Range("INTL_FX_1to6").EntireRow.Hidden = True
' ElseIf Sheet4.DrawingObjects("Option Button 163").Value = 3 Then
' Range("INTL_FX_1to6").EntireRow.Hidden = False
End If
End With
End Sub

Sub OptionButtonItem7to12_Click()
With Sheet4.DrawingObjects("Option Button 196")
If Sheet4.DrawingObjects("Option Button 196").Value = 1 Then
Range("INTL_FX_7to12").EntireRow.Hidden = False
Else
Range("INTL_FX_7to12").EntireRow.Hidden = True
'If Sheet4.DrawingObjects("Option Button 196").Value = 1 Then
' Range("INTL_FX_7to12").EntireRow.Hidden = True
' ElseIf Sheet4.DrawingObjects("Option Button 196").Value = 2 Then
' Range("INTL_FX_7to12").EntireRow.Hidden = True
' ElseIf Sheet4.DrawingObjects("Option Button 196").Value = 3 Then
' Range("INTL_FX_7to12").EntireRow.Hidden = False
End If
End With
End Sub
----------------------------------------------------

1. how do I loop the macro through the the first six groups of OB to
reflect if a user has selected the 2-6 group of OB without copying and
pasting for each "Other" OB from each of the 12 sets? In order words,
what must I add to the macro to ensure that the unhidden range is
visible if either 1 or all or any combination of the "Other" OB is
selected (I assume that once a user has selected an Other OB, further
selections of the Other OB within the macro do nothing).

2. once the macro has been updated for (1) above, can it be cloned for
the second section?

3. does it seem logical to have the FX values the user keys in (once an
Other OB has been selected) cleared if a later OB from that group is
chosen. I understand how to do that with one group of OB, but given my
question in (1), will that require significant coding?

Thanks in advance,
Dylan
 
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
Insert comments on Option Button of Forms Toolbar Rechie Excel Discussion (Misc queries) 2 March 14th 10 11:26 AM
Option Buttons from the Forms Toolbar - Excel 2003 mickey Excel Worksheet Functions 2 October 14th 07 11:32 AM
Can i use the button in forms toolbar and maneuver to differentt.. Denny Crane Excel Worksheet Functions 4 March 15th 06 08:45 PM
Option Button on Forms Toolbar admannj Excel Discussion (Misc queries) 4 January 25th 05 01:07 AM
Option Button and forms paradise Excel Programming 1 October 27th 03 12:32 PM


All times are GMT +1. The time now is 08:21 AM.

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"