JordanGoodchild
New Member
- Joined
- Jul 21, 2010
- Messages
- 28
i want to make a chart that uses data from several sheets. the data is in the same spot on every sheet i.e. range("E2").
is there a general way in VBA to do this. so far i have:
Each combobox picks the sheets that are available.
is there a general way in VBA to do this. so far i have:
Code:
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:=Sheets("" & Me.ComboBox1.Value).Range("E2")
ActiveChart.SetSourceData Source:=Sheets("" & Me.ComboBox2.Value).Range("E2")
ActiveChart.SetSourceData Source:=Sheets("" & Me.ComboBox3.Value).Range("E2")
ActiveChart.SetSourceData Source:=Sheets("" & Me.ComboBox4.Value).Range("E2")
ActiveChart.SetSourceData Source:=Sheets("" & Me.ComboBox5.Value).Range("E2")
ActiveChart.SetSourceData Source:=Sheets("" & Me.ComboBox6.Value).Range("E2")
ActiveChart.SetSourceData Source:=Sheets("" & Me.ComboBox7.Value).Range("E2")
ActiveChart.SeriesCollection(1).Name = "Protiens"
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="" & Me.TextBox1.Value
Each combobox picks the sheets that are available.