I have a table to build a chart. However, I don't know how many columns it has. It begins with the name in "A" and goes B, C, D... Depends on what's in each row. So, I don't even know exactly which column is filled.
For example:
Prop. |_A_|_B_|_|C_|_D_|_E_|_F_|_G_|_H_
NY___| 12.7| 13
CA___| 13 | 12
OH___|
TE___| 15 | 22 | 25 | 27 | 32 | 11
FL___| 0 | | 13 | | 15
In this case, the chart is from A2 (NY) to G6 (because there's a "11" in G5)
I tried the following code, but the program didn't accept to use:
.SetSourceData = Sheets(Sheets.count).Range("A2").CurrentRegion
And I can't use .End(xltoright) because it depends on each row
Sheets(Sheets.count).Range("A2").CurrentRegion.Select
Sheets(Sheets.count).Shapes.AddChart.Select
Selection.Width = 1000
Selection.Height = 500
With ActiveChart
.ChartType = xlColumnClustered
.SetSourceData = Sheets(Sheets.count).Range("A2").CurrentRegion
.Legend.Delete
End With
Bookmarks