I'm having some trouble, and if someone would be so kind as to help, I'd be incredibly grateful.
I'm trying to make charts from data that I have selected in a worksheet, using a macro (since I will end up making a few hundred of these). This is in Excel 07, by the way. Using the "Record Macro" feature, I came up with:
Sub Graph()
'
' Graph Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Frequency'!$I$4:$I$13")
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SeriesCollection(1).XValues = "='Frequency'!$A$4:$A$13"
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.Legend.Select
Selection.Delete
End Sub
I need to change the source, but I don't know how; the source of the graph needs to be whatever I have selected at the time, not the range I4:I13. However, the Xvalues need to always be A4:A13, as they are here.
How do I make it graph what I have selected on the chart?
Thanks,
A Noob
I'm trying to make charts from data that I have selected in a worksheet, using a macro (since I will end up making a few hundred of these). This is in Excel 07, by the way. Using the "Record Macro" feature, I came up with:
Sub Graph()
'
' Graph Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Frequency'!$I$4:$I$13")
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SeriesCollection(1).XValues = "='Frequency'!$A$4:$A$13"
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.Legend.Select
Selection.Delete
End Sub
I need to change the source, but I don't know how; the source of the graph needs to be whatever I have selected at the time, not the range I4:I13. However, the Xvalues need to always be A4:A13, as they are here.
How do I make it graph what I have selected on the chart?
Thanks,
A Noob