Excel VBA Dynamic Charting.

I have a set of data that needs to be charted that is changing based on drop down that the user selects.


The data looks like this

Product    | Month 1 sales | Month 2 sales ..... | Month 12 sales
product1          30                    30                           20      




The number of products changes drastically (1-40) based on a dropdown on another sheet. I'd like to graph  this data automatically using vba or any other trick.
sanjangeorgeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

can you provide a data sample in an Excel file and explain exactly what you want to chart? There are many ways to skin this cat.

cheers, teylyn
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Attached are some ideas for dynamic charts, including pivot chart, or charting by row or by column, as per user selection.

If your data source changes "drastically" please provide a few samples of how this could look, so the dynamic formulas can be adusted accordingly.

cheers, teylyn
Book1.xlsx
sanjangeorgeAuthor Commented:
Hi Teyln,

I've added some comments to your book.

Sanjan
Book1.xlsx
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

In that case, you can create a line chart off the complete source table, then set a filter on the source table and Excel will only plot the visible rows.

see attached.

cheers, teylyn
Book1.xlsx

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Spreadsheets

From novice to tech pro — start learning today.