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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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