i found a macro i'm trying to modify to create 91 column graphs with the source data based on a range
the below macro creates the graph but isnt selecting the source data correctly
the data ranges from column b-j 2 rows for each month and its 2 months of data
Data layout eg
Series one Series 2 Series 1 Series 2
A B C D
Sale percentage Profit percentage Sale percentage Profit percentage
Dec -2013 Dec 2013 Jan-2014 Jan-2014
44.3% 22.9% 52.8% 44.3%
27.9% 13.% 12.7% 25.8%
is there anyway to modify the below macro to select multiple series for the graphs?
thanks
Sub main()</SPAN>
'variable declaration</SPAN>
Dim i As Long</SPAN>
Dim LastRow As Long</SPAN>
Dim LastColumn As Long</SPAN>
Dim chrt As Chart</SPAN>
LastRow = Sheets("Month over Month").Range("b94:i94").End(xlUp).Row</SPAN>
LastColumn = Sheets("Month over Month").Range("B1").End(xlToRight).Column</SPAN>
For i = 2 To LastRow</SPAN>
Sheets("Sheet2").Select</SPAN>
Set chrt = Sheets("Sheet2").Shapes.AddChart.Chart</SPAN>
chrt.ChartType = xlColumnClustered</SPAN>
With Sheets("Month over Month")</SPAN>
chrt.SetSourceData Source:=.Range(.Cells(i, 1), .Cells(i, LastColumn))</SPAN>
End With</SPAN>
chrt.ChartArea.Left = 1</SPAN>
chrt.ChartArea.Top = (i - 2) * chrt.ChartArea.Height</SPAN>
Next</SPAN>
End Sub</SPAN>
the below macro creates the graph but isnt selecting the source data correctly
the data ranges from column b-j 2 rows for each month and its 2 months of data
Data layout eg
Series one Series 2 Series 1 Series 2
A B C D
Sale percentage Profit percentage Sale percentage Profit percentage
Dec -2013 Dec 2013 Jan-2014 Jan-2014
44.3% 22.9% 52.8% 44.3%
27.9% 13.% 12.7% 25.8%
is there anyway to modify the below macro to select multiple series for the graphs?
thanks
Sub main()</SPAN>
'variable declaration</SPAN>
Dim i As Long</SPAN>
Dim LastRow As Long</SPAN>
Dim LastColumn As Long</SPAN>
Dim chrt As Chart</SPAN>
LastRow = Sheets("Month over Month").Range("b94:i94").End(xlUp).Row</SPAN>
LastColumn = Sheets("Month over Month").Range("B1").End(xlToRight).Column</SPAN>
For i = 2 To LastRow</SPAN>
Sheets("Sheet2").Select</SPAN>
Set chrt = Sheets("Sheet2").Shapes.AddChart.Chart</SPAN>
chrt.ChartType = xlColumnClustered</SPAN>
With Sheets("Month over Month")</SPAN>
chrt.SetSourceData Source:=.Range(.Cells(i, 1), .Cells(i, LastColumn))</SPAN>
End With</SPAN>
chrt.ChartArea.Left = 1</SPAN>
chrt.ChartArea.Top = (i - 2) * chrt.ChartArea.Height</SPAN>
Next</SPAN>
End Sub</SPAN>