VBA code to plot graph and shade certain vertical sections of Scatter X Y graph

nonexpert

New Member
Joined
Mar 13, 2012
Messages
34
Hi all

I have two columns of identical data except one column is missing numbers.
For example, all the rows in column B contain a number. Column C is a duplicate of column B but some numbers have been excluded on certain rows.

I have already plotted column B on a Scatter X Y graph but I would like the VBA code to search through column C and where there are blank cells, I would like it to shade as light grey. For example, during a 24-hour period, certain data have been excluded in column C, say beween 3:00am and 4:00am. How do I shade the period between 3:00am and 4:00am on the graph (so it looks like a vertical grey bar that extends all the way to the top of the graph) to indicate excluded data?

Alternatively, is there a formula (instead of VBA) I could use to shade the relevant parts of the graph?

Thank you, I look forward to your replies~!
 

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