Human_doing
Board Regular
- Joined
- Feb 16, 2011
- Messages
- 137
Hi all,
Can anyone please take a look at the below code, which is supposed to cycle through each worksheet on a workbook and add a chart based on range M1:N10? The macro doesn't actually seem to do anything, any help much appreciated,
Thanks
Can anyone please take a look at the below code, which is supposed to cycle through each worksheet on a workbook and add a chart based on range M1:N10? The macro doesn't actually seem to do anything, any help much appreciated,
Thanks
Code:
Sub Chart1()
Dim w As Worksheet
For Each w In ThisWorkbook.Worksheets
Range("M1:N10").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=w.Range("M1:N10"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:=w.Name
Next w
End Sub