I want to generate charts in excel. I try following code in VBA.
Sub chrt()
'
' chrt Macro
'
'
Dim i As Integer
i = 3
Do While i < 6
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("STD 8-A").Range("B1:I1,Bi:Ii")
i = i + 1
Loop
End Sub
In that program I want to use auto-increment for Range("B1:I1,Bi:Ii") in which value of i which in loop and value of i which is in range can be change and auto increment. What is actual syntax for that. In above program loop is working but range not work proper working, and therefore program generate empty chart.