(Please - Bear in mind i have very little VBA knowledge) (Use Excel 2007)
I am working with large amounts of data from a doppler water current radar,
My data is:
1st row: C24-AB24 (which needs to be on Y-axis) (Heights of readings from sea floor)
2nd row & all other rows: C25-AB252 down to C4938-AB4938 - Each row as source data for X-axis in each graph (X-axis) in seperate graphs (readings of shore velocity at each height)
I am trying to create a macro that repeats the creation of graphs until the last row of data with some sort of loop command (for loop etc) - with each time selecting the next row (each row as X-source data for each graph).
I.E. each iteration (i), the same Y-source row (first) but the X-source from the second row and each of the next rows each iteration - producing a graph every i,
Please help me out to incorporate a loop command.
This is a script i recorded for the graph I'm trying to automate
' Macro2 Macro
'
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = "='Sheet3'!$C$25:$AB$25"
ActiveChart.SeriesCollection(1).Values = "='Sheet3'!$C$24:$AB$24"
ActiveChart.Axes(xlCategory).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlCategory).MinimumScale = 0
ActiveChart.Axes(xlCategory).MinimumScale = -0.6
ActiveChart.Axes(xlCategory).MaximumScale = 0.6
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).MinimumScale = 0
ActiveChart.Axes(xlValue).MaximumScale = 12
ActiveChart.Axes(xlValue).MaximumScale = 11
ActiveChart.Axes(xlValue).MajorUnit = 2
ActiveChart.Axes(xlValue).MajorUnit = 1
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select
Selection.Delete
ActiveSheet.ChartObjects("Chart 1").Activate
End Sub
Any help will be much appreciated thanks
Glenn Toms
Stellenbosch, South Africa
Bookmarks