Human_doing
Board Regular
- Joined
- Feb 16, 2011
- Messages
- 137
Hi all,
The below code (generated using macro recorder) creates a chart on worksheet '2x', can anyone please correct the code in order to make it loop through all worksheets on a workbook and create a chart on each? It would also be really beneficial if the chart could be placed one cell below the last cell with data on each workbook?
Thanks in advance for any help this would be really helpful,
The below code (generated using macro recorder) creates a chart on worksheet '2x', can anyone please correct the code in order to make it loop through all worksheets on a workbook and create a chart on each? It would also be really beneficial if the chart could be placed one cell below the last cell with data on each workbook?
Thanks in advance for any help this would be really helpful,
Code:
[FONT=Arial][SIZE=2]Sub Chart1()[/SIZE][/FONT]
[FONT=Arial][SIZE=2] Range("M1:N10").Select[/SIZE][/FONT]
[SIZE=2][FONT=Arial] Charts.Add[/FONT][/SIZE]
[SIZE=2][FONT=Arial] ActiveChart.ChartType = xlColumnClustered[/FONT][/SIZE]
[SIZE=2][FONT=Arial] ActiveChart.SetSourceData Source:=Sheets("2X").Range("M1:N10"), PlotBy:= _[/FONT][/SIZE]
[SIZE=2][FONT=Arial] xlColumns[/FONT][/SIZE]
[SIZE=2][FONT=Arial] ActiveChart.Location Where:=xlLocationAsObject, Name:="2X"[/FONT][/SIZE]
[SIZE=2][FONT=Arial]End Sub[/FONT][/SIZE]