Wednesday, August 29, 2012

Create chart and paste as image Vba

image

image

Sub grafico_dinamico()
    ' Crear gráfico
    Range("A10:C16").Select
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.SetSourceData Source:=Sheets("Ind_01").Range("A10:C16")
    ActiveChart.ChartType = xl3DColumnClustered
    ActiveChart.Parent.Name = "Ind_01"


    ' Pegar como imagen
    ActiveSheet.ChartObjects("Ind_01").Activate
    ActiveChart.ChartArea.Copy
    Range("A50").Select
    ActiveSheet.Pictures.Paste.Select
End Sub

No comments:

Post a Comment