Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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
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
Option button Pat Rice New Users to Excel 4 October 31st 08 02:36 PM
Option Button Pieter van der Walt Excel Discussion (Misc queries) 2 March 27th 06 12:02 PM
Option Button Pieter van der Walt Excel Worksheet Functions 2 March 27th 06 12:02 PM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM
option button? Pete Excel Programming 2 September 11th 05 02:51 PM


All times are GMT +1. The time now is 09:46 PM.

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

About Us

"It's about Microsoft Excel"