Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
option button help please
see if i can explain what i want to accomplish:
i have data validation dropdowns in a2 and a3, starting month to ending month, to run a report i have 3 option buttons, depending on the report to run i was wondering if there was a way to run whatever optionbutton code that was last selected when the value in a3 changes. right now, when i change the month in a3 and i want to run the report i just ran with different dates, i have to click one of the other option buttons and then come back and click the option button i want. i thought a worksheet change will do, and i can check to see what option button was last selected, but i don't know how to run its associated code.. -- Gary |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
option button help please
but i don't know how to run its associated code...
If it's a worksheet control, run whatever macro you assigned to it. If it's a Forms/VB control, simply call it's Click event as you would any other sub or function: OptionButton1_Click or Call OptionButton1_Click where OptionButton1 is the name of the control. HTH, -- George Nicholson Remove 'Junk' from return address. "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... see if i can explain what i want to accomplish: i have data validation dropdowns in a2 and a3, starting month to ending month, to run a report i have 3 option buttons, depending on the report to run i was wondering if there was a way to run whatever optionbutton code that was last selected when the value in a3 changes. right now, when i change the month in a3 and i want to run the report i just ran with different dates, i have to click one of the other option buttons and then come back and click the option button i want. i thought a worksheet change will do, and i can check to see what option button was last selected, but i don't know how to run its associated code.. -- Gary |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
option button help please
thanks, george, the optionbutton_click is what i needed. does this look ok?
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count = 1 Then If Not Intersect(Target, Range("A3")) Is Nothing Then If Worksheets("report").OptionButton1 = True Then OptionButton1_Click ElseIf Worksheets("report").OptionButton2 = True Then OptionButton2_Click Else OptionButton3_Click End If End If End If End Sub -- Gary "George Nicholson" wrote in message ... but i don't know how to run its associated code... If it's a worksheet control, run whatever macro you assigned to it. If it's a Forms/VB control, simply call it's Click event as you would any other sub or function: OptionButton1_Click or Call OptionButton1_Click where OptionButton1 is the name of the control. HTH, -- George Nicholson Remove 'Junk' from return address. "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... see if i can explain what i want to accomplish: i have data validation dropdowns in a2 and a3, starting month to ending month, to run a report i have 3 option buttons, depending on the report to run i was wondering if there was a way to run whatever optionbutton code that was last selected when the value in a3 changes. right now, when i change the month in a3 and i want to run the report i just ran with different dates, i have to click one of the other option buttons and then come back and click the option button i want. i thought a worksheet change will do, and i can check to see what option button was last selected, but i don't know how to run its associated code.. -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Option button | New Users to Excel | |||
Option Button | Excel Discussion (Misc queries) | |||
Option Button | Excel Worksheet Functions | |||
keep source formatting is not an option in paste option button | Excel Discussion (Misc queries) | |||
option button? | Excel Programming |