Hi,
I'm trying to copy and paste a chart by adding the code to my macro. The first option I tried worked but the chart was poor quality when pasted. I thought this would work but I keep getting an error.
Can anyone see what the issue is?
Thanks
I'm trying to copy and paste a chart by adding the code to my macro. The first option I tried worked but the chart was poor quality when pasted. I thought this would work but I keep getting an error.
Can anyone see what the issue is?
Thanks
VBA Code:
With ThisWorkbook.Worksheets("Summary").ChartObjects("OverallAverage").Chart.CopyPicture Appearance:=xlScreen, format:=xlPicture
ws.Range("Q2").PasteSpecial
End With
VBA Code:
Sub CreateNewSheet()
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlManual
Set ws = Workbooks("Book1.xlsx").Worksheets.Add(After:=Workbooks("Book1.xlsx").Worksheets(Workbooks("Book1.xlsx").Worksheets.Count))
ws.Name = ThisWorkbook.Worksheets("Summary").Range("E3").Value
With ThisWorkbook.Worksheets("Summary").Range("A71:N221").Copy
ws.Range("A1").PasteSpecial Paste:=xlPasteValues
ws.Range("A1").PasteSpecial Paste:=xlPasteFormats
ws.Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
ws.Range("A:N").Font.Size = 10
End With
With ThisWorkbook.Worksheets("Summary").ChartObjects("OverallAverage").Chart.CopyPicture Appearance:=xlScreen, format:=xlPicture
ws.Range("Q2").PasteSpecial
End With
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
End Sub