anghelm
11-07-2011, 05:55 AM
Hello,
I would appreciate if someone could help me with a school project!
I have an excel file containing several columns of various data.
I need add a macro that generates a diagram based on the selected(2) columns.
If i record a macro i get this code:
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Daten'!$A$1:$AS$1825")
ActiveChart.ChartType = xlColumnClustered
ActiveChart.Legend.Select
Selection.Delete
ActiveSheet.ChartObjects("Chart 18").Activate
ActiveChart.ChartArea.Select
ActiveChart.Parent.Delete
Selection.ClearContents
Range("H5").Select
I guess i need to set the parameter of .SetSourceData with the columns, but i don't know how.
Thank you for your help! :)
I would appreciate if someone could help me with a school project!
I have an excel file containing several columns of various data.
I need add a macro that generates a diagram based on the selected(2) columns.
If i record a macro i get this code:
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Daten'!$A$1:$AS$1825")
ActiveChart.ChartType = xlColumnClustered
ActiveChart.Legend.Select
Selection.Delete
ActiveSheet.ChartObjects("Chart 18").Activate
ActiveChart.ChartArea.Select
ActiveChart.Parent.Delete
Selection.ClearContents
Range("H5").Select
I guess i need to set the parameter of .SetSourceData with the columns, but i don't know how.
Thank you for your help! :)