View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default data range referrences

If you can use a defined name for the X and Y values for each series in the
chart, you can build dynamic charts that don't use VBA. Somehow when I read
your description, I assumed you didn't want to do that. The defined names
only work for the individual X and Y values, not for the total source data
range.

For info on creating dynamic charts:
http://peltiertech.com/Excel/Charts/...umnChart1.html
http://peltiertech.com/WordPress/dynamic-charts/

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______



"FatBytestard" wrote in message
...
On Thu, 21 May 2009 23:40:15 -0400, "Jon Peltier"
wrote:

This post has some VBA techniques near the end:

http://peltiertech.com/WordPress/dyn...t-source-data/

- Jon
-------
Jon Peltier, Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/

Advanced Excel Conference - June 17-18 2009 - Charting and Programming
http://peltiertech.com/Training/2009...00906ACNJ.html
_______


So you are saying that this is the best way to handle say leap year?

I was wanting to get along without any VB code. Oh well.

The data table for the 29th day would only receive data if there were a
day 29, a leap year. So I leave the table at 29 rows, and only select 28
rows for the chart. On leap year, I want to select 29 rows as the data
set referred to by the chart. All my other months' days keep track with
whatever year is being done, and February does too. Just not the chart.

I may have to explicitly call the sheet name, not merely the range name
I declared. I will try that, and get back to you. Your stuff is nice,
but I don't think I actually need a dynamic table to accommodate one
single additional row every fourth year. :-) The table is fine. The
chart needs to be able to be dynamically defined by accepting named
ranges as data range input. That I can switch in once every fourth year.

I mean I know I can make a separate chart and refer to that chart on
leap year and the other during the interim, but is that the most elegant
solution? Can I merely make another chart below the first February chart,
and make it a 29 day reference, and I guessI don't have to worry about
the year, since one 365th tick not filled would be barely noticeable.
Seems like a kludge for me to simply add a leap year chart on my February
Plot sheet, such that any monkey can tell which set of dual data is valid
for the year they are in.


Hmmm... divisible by 4, by 100, by 400... What's all this leap year
crud?!