R
Ray
Hello -
I thought I found an answer for this problem, but can't quite make it
work ....
As part of a large package of information, I have a ;dynamic' chart
sheet where users can change one (or more) criteria to see the level
of detail they want. Four graphs are created from this input. This
part of my code works fine and is not included in my sample code
below...
Here's the problem -- I only want ONE of the four graphs to be visible
at a time. Currently, I'm using 4 option_buttons to allow the user to
select the graph they'd like to see. The graph called by option1
should be the 'default' (ie visible on sheet_activate). Here's the
code so far ...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If OptionButton1.Value = True Then
ActiveSheet.ChartObjects("wkly_visitors").Visible = True
ElseIf OptionButton2.Value = True Then
ActiveSheet.ChartObjects("wkly_sales").Visible = True
ElseIf OptionButton2.Value = True Then
ActiveSheet.ChartObjects("wkly_customer").Visible = True
ElseIf OptionButton2.Value = True Then
ActiveSheet.ChartObjects("wkly_convrate").Visible = True
End If
End Sub
The code to update the graph has it's own macro and is called by a
click_event.
What am I doing wrong with the code above?
TIA, Ray
I thought I found an answer for this problem, but can't quite make it
work ....
As part of a large package of information, I have a ;dynamic' chart
sheet where users can change one (or more) criteria to see the level
of detail they want. Four graphs are created from this input. This
part of my code works fine and is not included in my sample code
below...
Here's the problem -- I only want ONE of the four graphs to be visible
at a time. Currently, I'm using 4 option_buttons to allow the user to
select the graph they'd like to see. The graph called by option1
should be the 'default' (ie visible on sheet_activate). Here's the
code so far ...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If OptionButton1.Value = True Then
ActiveSheet.ChartObjects("wkly_visitors").Visible = True
ElseIf OptionButton2.Value = True Then
ActiveSheet.ChartObjects("wkly_sales").Visible = True
ElseIf OptionButton2.Value = True Then
ActiveSheet.ChartObjects("wkly_customer").Visible = True
ElseIf OptionButton2.Value = True Then
ActiveSheet.ChartObjects("wkly_convrate").Visible = True
End If
End Sub
The code to update the graph has it's own macro and is called by a
click_event.
What am I doing wrong with the code above?
TIA, Ray