Excel: option buttons to update chart data

Experts!

I am using Excel 2007 to create a dashboard to show historical data.  My spreadsheet already has the working functionality of listbox that updates charts.  My question is how can I add to the existing code to allow the option buttons change the data on each individual chart?  If I can get an expert to show me on 1 chart I can take it from there.  The issues is that there are many ways but I am looking for the best way since I will have 30 charts to update.  The offset in executive rollup data col IX is what will need to be used to giive some assistance.  Perhaps new columns labeling 1d, 1w, 1m, 3,m, and 6m

The option buttons will be 1d (not ready yet), 1 week, (meaning week4 and week5, basically the way that it is currently set up and the prvious week from that) 1 month, 3 months, 6 month, and 1 yr.

I am currently working with the main dashboard only (Summary dashbord) and the data that is being pulled from is called "Executive Rollup Data".  I am starting to work with chart 115.

Thanks for your help!
 NOC-Reports-r14.xlsm
Maliki HassaniAsked:
Who is Participating?
 
dlmilleConnect With a Mentor Commented:
Ok - done .

Look at Executive Rollup Data - new columns from IX - JI  (the orange ones help you copy and drag the revised formula in the green range -note optional on showaddr function.

copied the red columns below over for this rollup

option button section in the CODEPAGE of Executive Rollup data - to set an integer value as to offset from last column (which is one day).  E.g., 6 months is the address 5 away from far right.  So the vlookup in the graphing area uses that to determine which range to use.

when option button fired, it sets that variable, then fires the listbox_lostfocus routine which pulls item selected and fires the graph...

obUsed - tells the graphing function whether an ob was used.  If not, it sets the date range to the 2-month window (for all other charts without option buttons) - its hard coded in the generic graphing function.

I think this is now reproduceable to the other summary sheets - just be sure to set the Ranges, after making the new columns (IX to JI).

after saving - go to Summary tab and select date range and it will update chart based on listbox selection and date range specified.

Dave
NOC-Reports-r15.xlsm
0
 
dlmilleCommented:
LANCE,

Do you need to have every chart have its own option button, or are all of them going to be looking at the same range?  I ask, because that's a lot of option buttons to keep track of.

You will perhaps want to consider naming your option buttons (rather than the automatically generated name) and your charts as well (as opposed to "Chart 123") and adjust your VBA code accordingly.  As you're having many charts and many option buttons, naming them could be useful.

Chart example - main chart in Summary tab could be called "MAIN"  or "Chart 1" where you number all your charts from the MAIN one going around clockwise.  See this tip from MSFT for changing chart names:  http://office.microsoft.com/en-us/excel-help/rename-a-chart-HA010223127.aspx

This COULD really help you maintaining your code, simplifying instead of you wondering what the chart number is, and having to click on it to find out, or if you DELETE a chart and REPLACE it with a new one, you'd have to change code addressing the chart, versus just naming it to its NAME based on position on the sheet, without having to change code!

The same applies to Option Buttons - you could give each one a name, based on its CHART identifier.  And that would help you in future maintenance/debugging/etc...

Something to reflect on, before you have HUNDREDS of buttons.  E.g., some summary sheets are like others, so the position of the charts and option buttons are the same, you're just duplicating features while content is different.

To change the name of an Option Button - just go into sheet DESIGN mode, then click on an option button to see its properties - you can change the name at the top.

So - if you do this on Summary Dashboard, you'll be able to DUPLICATE all your code to other summary sheets...  Let me know if I'm making any sense.

Dave
0
 
Maliki HassaniAuthor Commented:
I think this a great idea...  As for your 1st question I think I am going to have only the larger chart with option buttons, not the smaller charts.. If they want to data mine then they can go to the individual sheets like "surveillance dashboard".   As for the the rest of the sheets I am only going to put the option buttons on the one larger chart (linked to the list box).

This should make it a lot easier I think.  Now the issue is how to control the list box along with the 1d, 1w, 1m ,etc?
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
dlmilleCommented:
Yes - I was just noodling how all your option buttons on the one page are in a group, so there is only one selected - so I was going down that route.

Simplified is good - at least till you get your protype working and it gets complicated to have them on different sheets as you don't have firing code developed yet and now I don't have to do that :)

The date range work is already done, I was just tying it to the ob (ob-option buttons).

Dave
0
 
Maliki HassaniAuthor Commented:
Yeah the grouping of the ob would not work .. I had grouped them to navigate around and develop the design.  As I figure the date range would be designed the same as the 8 week range.  I would have to tell it to change from -8 to whatever the required interval would be.  Is that the case?
0
 
dlmilleCommented:
hang on - need 10 mins

Dave
0
 
dlmilleCommented:
PS - from an earlier question:  here's a start on a listbox control that allows you to change colors.  It uses the ListView control that I've only started playing with - its an anachronism from earlier versions of Excel.  Creating your own Listbox class is the other alternative (which I'll take a look at as well, in my spare time)  Proceed at your own risk :)

http://www.ozgrid.com/forum/showthread.php?t=20549&page=1

Dave
0
 
Maliki HassaniAuthor Commented:
OMG you are by far the best on EE!  Your mod is perfect!  I am looking over everything now.  Just had to tell you that my jaw dropped while I clicked the ob...  :)))
0
 
Maliki HassaniAuthor Commented:
Quick question:  I am starting the process of making the smaller charts dynamic.  These chart will be fixed ID's and just update the weekly values.  Should I be defining the names to make ranges like I did in the past?  I tried to select data source and input the cell that has the range but that doesn't work.  Any ideas how I should go about this?
0
 
dlmilleCommented:
why not set them up just like the main chart?

Put one together, hardcoding the range.  Then, post your question (to tie it to a range based on the rules you want to apply).

Dave
0
 
dlmilleCommented:
oh - figure out what the offset equation would be for the series, then go to the series itself in the chart and paste that in.  You're good at offset functions as demonstrated by the chart.  Its essentially what we're doing with the main chart, except I believe you just want to tie it to a fixed timeframe, so its back to the way you originally designed this (without the defined names) - just put the formula directly into the series.

See the tip here as someone else was trying to do the same thing....

http://www.experts-exchange.com/Q_26817857.html

Dave
0
 
dlmilleCommented:
Well, you could use defined names if you wanted.  You just don't HAVE to.  

Apparently MSFT  has no problem with it: http://support.microsoft.com/kb/183446

and might be easier to maintain, if you ever want to change them...

Dave
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.