Specifying a column of data for the x-axis

Jacek

New Member
Joined
Jul 11, 2011
Messages
19
I presume this is a very simple task yet I really can't seem to find the solution after browsing the web for a good 30 minutes (and I also presume this question has been posed more than once..).

Anyway, what I would like to do is specify a particular column of data from another worksheet to serve as my x-axis for a chart in my current worksheet.

I really don't know how to write this into VBA code. All I have is my chart specifying its SourceData from a range variable that I defined for the actual plotted data.

So I would like to have the values from another worksheet in the range A2:A1442 as my x-axis values...how can I write that in VBA? Oh and I know that's a lot of values, so I don't expect to have all of them showing, but I would like to show the first and last (A1 and A1442) values at each end of the axis.

Thank you in advance!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
in 2007 you can click on your chart, then click on Design Ribbon and then choose Select data.

Then in the dialog box you can change the
Horizontal (category) Axis Labels on the right side of the dialog box then just choose your range.
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

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