zerog
asked on
Change data on Excel Graph from dropdown
I have an Excel workbook with 4 sheets (Terms 1, 2, 3 and 4). The last sheet has a graph. How would I get the data that plots the graph to change based on the dropdown selection (i.e. either term 1, 2, 3 or4). Sample file attached
Template_4.xlsx
Template_4.xlsx
Hi,
pls try ( in the "graph" sheet module)
Template_4v1.xlsm
pls try ( in the "graph" sheet module)
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("b2")) Is Nothing Then
With Sheets(Replace((Sheets("graph").Range("B2").Value), " ", ""))
Set chrtdata = .Range(.Range("B1"), .Range("E" & Rows.Count).End(xlUp))
Me.ChartObjects("Chart 1").Chart.SetSourceData Source:=chrtdata
End With
End If
End Sub
RegardsTemplate_4v1.xlsm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Rgonzo1971 and byundt
I decided to go with the non-macro version of the solution by byundt. Thank byundt, your explanation has taught me a lot for future solutions
I decided to go with the non-macro version of the solution by byundt. Thank byundt, your explanation has taught me a lot for future solutions
http://www.get-digital-help.com/2013/07/03/use-drop-down-lists-to-compare-data-series-in-an-excel-chart/