I have a workbook with several Chart Sheets. I want to create a sheet where all charts can be easily found all at once, so I can rapidly copy and then paste them in powerpoint presentations.
My code can copy, paste and change the size of each chart sheet just fine. The trouble comes when I try to organize them in the sheet.
The thing is that the code pastes them all in a single line. If, for instance, I have a large number of charts, finding a specific one could take too much time.
I would like to organize all charts in something of this sort, disposing a specific number of charts for each row (say, for instance, 2 charts per row).
I tried to use the .left property for charts, but it aligns all charts to the same column (and please notice that this is not my intention).
I have also tried to introduce a variable for the rows, but I have trouble in controlling when the variable should "jump" for the next row to paste the chart.
Any ideas if this is feasible?
Sub PasteCharts()
Dim wb As Workbook
Dim ws As Worksheet
Dim Cht As Chart
Dim Cht_ob As ChartObject
Set wb = ActiveWorkbook
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
'k is the column number for the address where the chart is to be pasted
k = -1
For Each Cht In wb.Charts
k = k + 1
Cht.Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
Sheets("Gráficos").Select
Cells(2, (k * 10) + 1).Select
ActiveSheet.Paste
Next Cht
'Changes the size of each chart pasted in the specific sheet
For Each Cht_ob In Sheets("Gráficos").ChartObjects
With Cht_ob
.Height = 453.5433070866
.Width = 453.5433070866
End With
Next Cht_ob
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
MsgBox ("All Charts were pasted successfully")
End Sub
