Hi,
I've been struggling with this piece of code. First I must say that I'm not an expert in VBA. I want to copy a chart that it's located in Sheets("Graficos") to a chart object (myChart), modify it and paste it into another sheet (Sheets("Informe")). This is the code that I'm working on but I'm not able to make it work:
I've been struggling with this piece of code. First I must say that I'm not an expert in VBA. I want to copy a chart that it's located in Sheets("Graficos") to a chart object (myChart), modify it and paste it into another sheet (Sheets("Informe")). This is the code that I'm working on but I'm not able to make it work:
VBA Code:
Dim myChart(1 To 100) As Chart
Dim chartNumber As Integer
Dim IMC As Double
'Some code here
ThisWorkbook.Sheets("Graficos").ChartObjects("Chart 2").Activate 'Para evitar error al crear la imagen
ThisWorkbook.Sheets("Graficos").ChartObjects("Chart 2").Copy
Set myChart(chartNumber) = ThisWorkbook.Sheets("Informe").Shapes.AddChart(xlLine).Chart
myChart(chartNumber).ChartObjects.Paste 'THIS IS NOT WORKING'