Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chart category (X) axis labels:

Status
Not open for further replies.

westicle47

Programmer
May 24, 2004
20
GB
I want to this to display 1 2 3 4 5 6 7 8 9 10 etc.

The only way I can do this is to enter "={1, 2, 3, 4, 5, 6, 7, 8, 9, 10}".

Is there a way of writing something like ={1 to 10)? Nothing I can think of is working?
 
The only way I can do this is to enter "={1, 2, 3, 4, 5, 6, 7, 8, 9, 10}".

what's your point ?? just enter the numbers or reference a cell range
 
Sorry I re read my question and it's not very clear. I actually want the amount to go from 1 to 100 eventually. It's a chart that is created by a macro and I want to find a way of entering the values 1 to 100 other than typing them all out. I figure there is probably a way of writing something like ={1 to 100} or ={1...100} that then enters the values for me.
 
unfortunately not
easiest (well - least typing) way would be to code a loop which writes to an excel range and then use that to base your chart on

For i = 1 to 100
cells(i,1).valaue = i
next i

then base the chart on that outputted range
 
Hi,

You do not specify a range or text for the axis labels it defaults to 1,2,3,4 etc up to the number of data points.

Right click the chart and bring up the Source Data dialog and then clear the Category labels range.
 
I think that's what i'm trying to get around.

It's a graph of age groups and numbers of people in each age group.

I want the x axis to show ages 1 to 100 and there are only 55 age groups in my data so it's putting points 1 to 55 on the x axis. I want to include an age group even if there is no one in that group.
 
so what is the issue with my solution??

wouldn't even need to code it - just have a hidden sheet with a range filled 1-100 - reference that as the X-axis labels
 
No major issue. I'm currently doing something similar. I was trying to get this to work with the minimum of code and without extra sheets if possible. I thought I would be able to just tell the graph how many points I want on the x axis.

I guess there is no other way though.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top