Colors on VBA

tennisplayer

New Member
Joined
Dec 4, 2010
Messages
11
On VBA, how do you make half a graph one color and the other half of the same graph a different color?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
No entirely sure what you mean but....Why not plot two sets of data and set a different colour for each one
Excel Workbook
ABCD
1NameDataPlot1Plot2
2a152152#N/A
3b5050#N/A
4c3434#N/A
5d56#N/A56
6e198#N/A198
7f115#N/A115
Sheet1
Excel 2007
Cell Formulas
RangeFormula
C2=IF(ROW()-1<=COUNTA($A$2:$A$7)/2, B2, NA())
D2=IF(ROW()-1>COUNTA($A$2:$A$7)/2, B2, NA())


The result

graphg.png
 
Upvote 0
But how would you make it so that for example for a line-scatter plot A2-A7 is one color while A8:A15 is another color?
 
Upvote 0
I tried a similar data set on both a line and scatter plot and here was the result

graph2n.png
 
Upvote 0
Using a dataset similar to the set above (slightly bigger) I highlighted columns A, C & D and inserted a chart based on them. The colours were the default colour, there are two ranges being plotted so they should automatically be different
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,752
Members
448,989
Latest member
mariah3

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