I recorded a macro to create graphs on a worksheet.
The data are organized in the same way in all the sheets of the workbook, therefore I would like to generalize the macro so that it can be used on every sheet (or if it is possible to batch through the worksheets).
The code looks like this:
ActiveWindow.SmallScroll Down:=-57
Range("C5:C65").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Range("fr_1!$C$5:$C$65")
ActiveChart.Axes(xlCategory).Select
ActiveChart.SeriesCollection(1).XValues = "=fr_1!$A$5:$A$65"
Having recorded the macro on fr_1 I now have that reference in the 5th and last line, while I would like to have a general reference to the active sheet.
How do I do this?
You can:
If you want to iterate the manually selected sheets change to
for each asheet in activewindow.selectedsheetsTo manually filter by name;