Copy/Paste Charts with VBA... line drops to zero

programsam

Board Regular
Joined
Feb 10, 2016
Messages
123
Greetings,

I'm having an issue with a chart that displays year-over-year data by month.

The issue is that 2021 displays January - December wonderfully however, 2022 displays January - July data and then immediately drops to 0. I am well aware of the Office 365 / Excel 2016 enhancement that allows you to show empty cells as Gaps and show #N/A as an empty cell and this works on my local file.

That said, I'm using VBA to copy/paste the chart to a new Workbook and where I have most everything working, this option does not carry over to the newly created Workbook. I'm wondering if there is a way to select these options using VBA? Can anyone point me in the right direction?

Not posting code because this is a smaller part of a much larger script and I'm almost positive that (if possible) it's only a few lines that need to be added. Is this possible and if so, any ideas on what said code should look like?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top