ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Variable Axis Length (https://www.excelbanter.com/charts-charting-excel/193352-variable-axis-length.html)

Krys

Variable Axis Length
 
Hi, since I got help on here last time, I was wondering if anyone could help
with this problem...

I have built a spreadsheet to show trends in our results. The macro runs
through selecting the relevant data, sorting then filtering it and then
building a graph to show the trends. As the number of results used in the
chart varies based on the dates entered (ie. between these two dates), the
macro selects an arbitrarily large column length for the data( eg. D2:E5000),
then uses Go To to reduce the selection to the last constant in the selected
area, then builds the chart from this selection. The macro does not seem to
recognise this though and will show the graph using values from D2:E15 as
this was the area selected in the building of the macro. What can I use in
the macro so size of the selection used is fluid and more or less values can
be shown in the chart?

Any help is greatly appreciated.

ShaneDevenshire

Variable Axis Length
 
Hi,

Please show us the code:


--
Thanks,
Shane Devenshire


"Krys" wrote:

Hi, since I got help on here last time, I was wondering if anyone could help
with this problem...

I have built a spreadsheet to show trends in our results. The macro runs
through selecting the relevant data, sorting then filtering it and then
building a graph to show the trends. As the number of results used in the
chart varies based on the dates entered (ie. between these two dates), the
macro selects an arbitrarily large column length for the data( eg. D2:E5000),
then uses Go To to reduce the selection to the last constant in the selected
area, then builds the chart from this selection. The macro does not seem to
recognise this though and will show the graph using values from D2:E15 as
this was the area selected in the building of the macro. What can I use in
the macro so size of the selection used is fluid and more or less values can
be shown in the chart?

Any help is greatly appreciated.


Jon Peltier

Variable Axis Length
 
You have to replace reference to "D2:E15" in the macro with a reference to
the range that you really want to use. You may have replaced a reference to
the selected range, then not changed the reference in Chart.SetSourceData.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Krys" wrote in message
...
Hi, since I got help on here last time, I was wondering if anyone could
help
with this problem...

I have built a spreadsheet to show trends in our results. The macro runs
through selecting the relevant data, sorting then filtering it and then
building a graph to show the trends. As the number of results used in the
chart varies based on the dates entered (ie. between these two dates), the
macro selects an arbitrarily large column length for the data( eg.
D2:E5000),
then uses Go To to reduce the selection to the last constant in the
selected
area, then builds the chart from this selection. The macro does not seem
to
recognise this though and will show the graph using values from D2:E15 as
this was the area selected in the building of the macro. What can I use in
the macro so size of the selection used is fluid and more or less values
can
be shown in the chart?

Any help is greatly appreciated.





All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com