Can charts automatically change by entering new range of dates

S

Sean Moor

I am creating a Dashboard report for my Accounting department at work and I
have a weekly one I set up with links for the series of a chart to another
worksheet. Easy. But what I am trying to do is instead of creating a new
one each week by changing the link location for the data is there a way I can
just enter in a range of dates and the charts automatically change and filer
in the new data without me having to change the link in the series where the
data entry is coming from??
 
S

Sean Moor

Thanks for the reply Jon. Unfortunately I was not able to understand that
tutorial and I don't know much easier you can explain it to me. Really just
wanna have my charts created basically by entering in a range of dates
anywhere in the spreadsheet and have the chart automatically read that and
know where the range of data is and be able to be produced automatically
instead of having to change the series inside the chart data everytime I want
to see a new chart.

Sean
 
S

Sean Moor

And BTW would it be easier to be creating a macro for this setup or no?.. If
so whats the best place I can go to to find out an easy macro setup?
 
J

Jon Peltier

Excel isn't magic, it needs a mechanism to know that the two dates you enter
refer somehow to the total data range, and to apply the subset of the data
range to the chart. The tutorial I cited provides that mechanism.

- Jon
 
J

Jon Peltier

I don't think a macro would be any easier than setting up a worksheet- or
formula-based solution, especially if you're not familiar with VBA. There
are no "easy macro setups" if you don't know how to set up the problem. VBA
isn't magic, it only does what Excel can do, but allows you to do it
automatically.

I suggest you refer to the tutorial I cited, perhaps after reading about
dynamic charts and defined names.

Dynamic Charts:
http://peltiertech.com/Excel/Charts/Dynamics.html
http://peltiertech.com/Excel/Charts/DynamicColumnChart1.html
http://peltiertech.com/Excel/Charts/DynamicLast12.html
http://peltiertech.com/Excel/Charts/DynamicChartLinks.html

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

Sean Moor

Hey Jon,

Wow thanks for those links. The one I found that will work the best is the
Interactive Chart Creation as anyone can pick where they want the chart to go
and what data boom done.

Few questions though. It does come up as a built-in chart style which I
would prefer either a column or pie chart instead is there a way in the
macro/vbe to change so instead of the built-in one thats in there to make a
different kind of chart instead so I don't have to change the chart type
after its created.

As well for my weekly report I do end up having around 4 different charts
plotting 2 stats on each. Is there a way with this interactive setup to
generate 4 different charts at one time like that instead of doing one and
then just following the same set up and doing it again to 3 more?

Thanks again
 
J

Jon Peltier

The procedure as posted is pretty simple. It can certainly be made as
complicated as you'd like, changing the chart type (I think it uses the
default, so you could change your default to make different types), even
making multiple charts from a single selected range. Without knowing
details, it's not easy to make specific recommendations, and of course, this
starts to become a development project once it starts to grow custom
features.

- Jon
 
S

Sean Moor

Sounds great ya I was trying out a few things at work and I can easily change
the chart type by changing the default and the basic outlook of the chart
just in the VBE, going to be nice to learn all of it.

Only thing is the options I like with the popup asking where the chart to be
put but when it asks for where the data is from I want to be able to type say
May 12 and have 4 charts come up with the data I have in my system from May
12. Like for example one chart would be my cash/charge sales, one would be
my accounts opened/closed, one would be $/contract compared to last year and
finally my Month to Date sales compared to last years. Those are the 4
charts I want to create based on just entering in a date. I am thinking once
I get it going I'll probably have to in the code write alot of IF='s right?
like basically if=May 12 then it knows where to find the data and then create
4 charts out of it?

Thanks
 
J

Jon Peltier

Here's that development project I alluded to. You need to change the
interface, replacing the simple inputbox with a userform to list the
available dates. Then the code has to somehow examine the data and parse out
just what you need.

Or... You could set up a filter on your data, and use it to display the date
you want, and hide the rest. By default, data in hidden cells do not appear
in the chart.

That's if the dates are in a single column, with the data lined up in
sequential rows. If you have different columns for each date's data, use
something like this:

http://peltiertech.com/Excel/Charts/ChartByControl.html

- Jon
 
S

Sean Moor

Hi Jon,

Actually the first part of your email would be exactly what I want to do.
Be able to instead of having the popup box to ask where the data is coming
from instead to just have either a popup asking what Day(s) you want to chart
or even a drop down menu with dates listed for a starting date and say
another for end date or just one doesn't matter. I was able to get the macro
going and change for my chart default look so that was good but just unable
to get it to chart by user entered date instead of the usual just point and
click on the data. As well as it is a setup to make one chart but I do need
to make 4 charts and preferably just at once. So basically just say enter in
May 10-May 18 and have the chart automatically know where the data for those
dates is and make 4 separate charts all together. If thats not possible I
could always just do it 4 separate times just trying to make it easier on
people at work to be able to go in there themselves and do it as easy as
possible. If you want I can send you a copy of the spreadsheet of data for
example just change my #s and see if you can see what you can do to get this
going.

Thanks again for your help
Sean
 
S

Sean Moor

Yes I have and I thoroughly read it over but wasn't able to get done what was
explained. But I will try that again today and get back to you. Although it
still doesn't allow me to create multiple charts of different data at once
like I was planning just one chart at a time. Cause say for example I have
Cash Sales/Charge Sales, $/Contract 08/$/Contract 07, Opened/Closed
Contracts, MTD Sales 08/MTD Sales 07. Each of those I want graphed to each
other compared so all together 4 graphs. So say I use that user interface
and type in May 10 Start Date and May 18 End Date I want the chart to be able
to make 4 separate charts for the Data in those dates. And yes the Data is
all in one row to make it easier but I would assume I would have to enter in
where the Data is located on the spreadsheet and what columns contain that
data? Cause in each date there is also other information that I don't want
to be charted.

Thanks
 
S

Sean Moor

Any news Jon?

If maybe emailing you my spreadsheet of data and the charts I want to look
like that might help if you have a few mintues you can look it over and see
kind of where I am getting at and exactly what I am tryingt o do because I
have read over all the websites and pulling my hair out here to try to figure
it out
 
S

Sean Moor

Hey Jon I finally got it done. I was able to create the Dynamic Charting by
Dates from your website I was just missing a few points I never saw before
and finally got it going. One question though about it. What if in AllDates
I want to include more than one month. Each month in my spreadsheet has its
own tab is there a way to include multiple tabs in 1 spreadsheet to the
defined name of AllDates?
 
J

Jon Peltier

To work as described, the dynamic names must each be contained within a
single sheet (not necessarily the same as other dynamic names). In addition,
a chart's source data can only under some circumstances be drawn from
multiple sheets. All the X values must come from one sheet, all the Y values
from one sheet, and the cell containing the series name from one sheet (duh,
it's one cell). This means a series can contain data from up to three
sheets., but cannot be spread across sheets the way your data is.

- Jon
 
S

Sean Moor

Aww thanks for the reply but that sucks ya. I was working on this for quite
sometime and finally have it from your site that I can do any date range I
want for a single month but multiple months in 1 chart I can't since each
month has its own tab on one spreadsheet. I did send you an example of what
it looks like and what overall I am trying to do through email not sure if
you got it or not. If you have or haven't is there anyway I can do this now
when I want to graph multiple months if possible on one chart? For ex last 3
days in April and first 4 days in May.

Thanks
 

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

Top