EXCEL: Chart not Updating when Value on Dropdown changes - excel

I created a chart which automatically updates ranges when data is added to the source table. I added a dropdown menu which tells the chart what data to display/show. My problem is, the chart doesnt automatically update when the dropdown value is changed, i need to press CTRL+SAVE for the data to match the value on the dropdown. Can someone please point me to the right direction?
here's an image of my graph. as you can see, the dropdown has three options. if i change the dropdown value, the chart wont update unless i press CTRL+S. Please note that I am not using vba/macro for this.
Thanks in advance.

Not sure but maybe automatic calculation is off

Related

Spin button for showing Month by Month on Chart Graph

So i have the template layout in the picture attached below. I would like to know how to link the Spin button to able to show month by month when i click on the spin button.
Here is the formula i have so far, everything working fine except for the chart doesn't connect to the spin.
E4 formula : ="Monthly "&E5&" - Audit Sheet Delivery"
data for eat month for LATE row:=IFERROR(VLOOKUP(G3,$A$4:$C$6000,2,FALSE)," ")
Same for On-Time:=IFERROR(VLOOKUP(G3,$A$4:$C$6000,3,FALSE)," ")
Spin button link to cell $E$5
I have created define name for each Month, Late and On-Time and linked it to the chart but it doesn't work.
Please point out what i have to do in this case. Also, please show the code on here due to i am new to this. Thanks
Thanks you all for your help. I did figure out one way to make it work for me. However, i will more than happy to learn new way or a better way to use spin button and scroll button to changing my chart.
Changes data layout table
Using index formula and vlookup (Cell F19, G19,H19) formula included in picture below)
Changes define name formula to pull data from Cell (Cell F19, G19,H19).
Now i can click on my spin button and the chart changing month by month for me.
It is working fine for me. But i love to learn more if anyone can show me a better way to do it. Please include pictures and formula in your answer. It will help me and other easy to follow it. Thanks
How to do anything anything Excel can do, but with VBA code:
Virtually anything you can do manually in Excel (ie, via the ribbons/toolbars) has an equivalent in VBA.
If you are unsure of which VBA method or property to use, you can turn on the macro recorder and manually perform the action. The macro recorder translates your actions into Visual Basic code. After you record your actions, you can modify the code to do exactly what you want.
There are some limitations to recording macros, so if needed, certain actions have to be added after recording, such as conditional branches (eg., IF statements), variables usage loops, error handling, and text selections made with the mouse (however keyboard combinations do record).
Record an action:
For example, if you want to automate the process of saving the file with a new name, but you don't know which property or method to use, you could do this:
On the Developer ribbon, click
Change the default macro name to a name of your choice and click OK to start the recorder.
Hit F12 to open the Save As... dialog and save the file with a new name.
On the Developer ribbon, click
On the Developer ribbon, click Macros.
Select the macro name that you assigned (in Step 2) and click to view the VBA code within.
See the tips & resources at the links below to help get you started with automatizing Excel (and other Office applications) using VBA code.
More information:
Office.com : Assign a macro to a Form or a Control button
MSDN : Getting Started with VBA in Office
MSDN : Recording a Macro to Generate VBA Code)
MSDN : Revising Recorded VBA Macros
homeandlearn.org : Excel VBA For Complete Beginners
Stack Overflow : Overview of Form Controls and ActiveX Controls
Original Post:
How to filter a chart
The ability to filter a chart by month is built-in to Excel. After you create a chart, you can change the data series in two ways:
Use chart filters to show or hide data in your chart, or,
Use the Select Data Source dialog box to edit the data in your series or rearrange them on your chart.
Filter data in your chart
Click anywhere in your chart.
Click the Chart Filters button next to the chart.
On the Values tab, check or uncheck the series or categories you want to show or hide.
Click Apply.
If you want to edit or rearrange the data in your series, click Select Data, and then follow steps 2-4 in the next section.
Once you know how to use the filters, you can record a macro while filtering as required, an use the code for buttons or other controls.
More Information:
Office.com : Change the data series in a chart
MSDN : Recording a Macro to Generate Code
MSDN : Revising Recorded Visual Basic Macros
Steps
This is broadly similar to yours. Below is just meant to show you how to use dynamic named ranges as chart series sources. If you later decide to specify start and end ranges of months, you could use this same model and have the start and end indexes generate the height argument for Offset thus being able to plot ranges (though they would be aggregate).
Using the same data layout as in your answer.
① Add a forms control spin button, assign its linked cell as K3, then put the font to white so it is not visible. Its values run from 1-12 with increment 1.
② I then create two dynamic ranges:
LATE with formula =OFFSET(Sheet1!$G$4,Sheet1!$K$3-1,0,1,1)
OnTime with formula =OFFSET(Sheet1!$H$4,Sheet1!$K$3-1,0,1,1)
You can add these via name manager (Alt+F3)
Name manager:
③ I then insert a bar chart and add two series which use these dynamic named ranges as their source:
The above is for Late and this is repeated for OnTime. Note that the workbook name goes before the reference to the dynamic range.
④ In J2 I enter the chart title text "Monthly - 5 KPI Delivery" and point the chart title at this with = J2 in formula bar whilst chart title is selected on the chart.
⑤ K2 has the formula =INDEX(F4:F15,K3) and is used to retrieve the Month name from the list of months via Index with row argument the linked cell value from the spin button.
I then edit the chart X axis source with formula =Sheet1!$K$2 so the month name appears on the bottom of the chart.
⑥ Finally, any other chart sprucing you like. I chose to group and lock the chart and spin button together so they will move as a unit and to ensure data point values where shown.
Final result:
In action:

Dropdown not working. Why do I get a data validation error?

I'm working with a template that has formula which displays drop down list. In this template, I'm copying over several plans that have already picked an item from the drop down list. However, when the plan is copied over, the data validation error occurs and if I want to change the item from the drop down menu, I'm not able to do that. Can you please advice how can I sync the data with the formulas created already?
Here is a screenshot:
When I click on the arrow, the list is not displaying.
I managed to fix it myself with help of comments under my questions. When I paste new rows in the column, the current rule is not applied for them automatically. What I did was to create a list again for the column. I clicked on the column header-> data validation> selected list-> then added all options/items for the list. I can change value of pasted items.

In Excel, is there a way to link a dropdown menu to specific data?

Essentially what I have done so far is create a dropdown menu using the Data Validation tab within the 'Data' tab in Excel. Using a SS I will show what exactly I'm trying to do.
If this can also potentially be done with a vba macro please let me know.
Essentially, when I change the data (where the blue arrow is) I want different data values to appear in the table (in the red circle) for each different item in the dropdown box
Please let me know if this is possible in Excel, thanks in advance for the help!

Create Scrolling Excel Chart

I'm looking to set up a scroll bar in Excel that corresponds to what set of data I use for a chart. I have built a 2-value doughnut chart that acts as a percentage gauge (green section is completed and grey is 100% minus the completed part).
I want to be able to choose what month's data I use for this chart using the scroll bar. All I can seem to find online is how to modify the number of rows and columns that are displayed on a graph rather than actually using the scroller to pick what data to display.
In addition, how would I make it default to the current month? Any help would be appreciated!
For anyone that is looking for a similar solution, I have figured it out. It works with something called a dynamic range. Use the value of the scrollbar to determine the offset of rows (pick which row of data to use). Then link that dynamic range to your chart in place of where you would select the data.

Excel: Charts for Filtered Ranges are Showing Up Blank

I have a document that I have built tables of data into that are formula driven. I created charts for these tables and for reporting purposes applied filters to these tables to make the charts more readable. The way this works is the user selects an option from an ActiveX combo box which triggers the filter on the table thus making the chart only display the filtered values. All of this works very well except when I add more data in the form of new row or columns to my table. The result is when you select an option from the combo box the chart just appears blank. This only happens sometimes and I have yet to figure out why. The attached picture is showing what the charts data looks like when I chose select data after this problem occurs. As you can see there is data that should be displayed in the dialogue box but it appears empty, likewise the chart is empty. If I copy and paste the chart the data then appears in the new chart, until I select a different option from the combo box, then it disappears again. Very confusing and frustrating. Any ideas as to why this is occurring?
I figured it out! I needed to recalculate the sheet.
Worksheets("Sheet1").Calculate
This seems to work fine.

Resources