create a chart without set range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a 2 columns of data which can vary in length.

Is it possible to create a chart where you only have the start range but not
an end range.

Example:

1 5
2 1
3 6
5 1
23 8
45 4

I want to produce a chart where it show goes to the first column (1) and
then uses the code range(selection, selection.end(xlDown)).select uses the
range that is highlighted as the x axis and then do the same thing for the
second column (5) as Y axis.

This is required as we do not know how many lines of data there will be each
time we create a new chart as we wont the chart to be created by using a
button rather than manually doing it each time.

I hope this makes sense and someone can help.

Thanks
Noemi
 
Hi Tushar
Can you please confirm if I am meant to replace the set ranges with the 2
formula's that have to do with adding additional data.

I seem to be having trouble understanding what and where I am to place the
code plus it doesn't seem to like it in my code.

Thank you for your help.
Noemi
 
The solution doesn't require any VBA code; it relies on named formulas.

If you want the code to create the named formulas, turn on the macro
recorder (Tools | Macro > Record new macro...), create the names as
shown in the web page, and turn off the recorder. XL will give you the
necessary code.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top