I have a list of items. I want to use a ComboBox to choose an item and show the graphs associated with that item. This code uses a drop-down box:
But you have to click another cell and then click back on the original cell for the graph to change. Would the ComboBox code be the same? Would I just change it to
? Also Would I need to put every graph on the sheet? If I choose an item from the combo box, wouldn't that only show one graph with that name instead of all graphs with that name?
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$C$1" Then
ActiveSheet.ChartObjects.Visible = False
On Error Resume Next
ChartObjects(Target.Value).Visible = True
End If
End Sub
But you have to click another cell and then click back on the original cell for the graph to change. Would the ComboBox code be the same? Would I just change it to
Code:
Private Sub ComboBox1_Click()