I want to be able to copy and paste an Excel Chart using vba to set number of worksheets, but to adjust the range for the charts to that particular spreadsheet, this how far I've gotten but I have an error
Code:
Sub CopyCharts()
Dim Wkb As Excel.Workbook
Dim ws As Worksheet
Dim ws_count As Integer
Dim i As Integer
Sheet4.ChartObjects("ALLDeals").Copy
Set Wkb = ThisWorkbook
ws_count = Wkb.Worksheets.Count
'Begin loop
For i = 4 To ws_count
Set TargetSheet = Wkb.Worksheets(i)
TargetSheet.ChartObjects("ALLDeals").Paste
Sheet4.ChartObjects("ALLVolume").Copy
TargetSheet.TargetSheet.ChartObjects("ALLVolume").Paste
Next
End Sub
Last edited: