?
Solved

Excel VBA - Applyinging newly imported data range to a chart

Posted on 2013-01-07
4
Medium Priority
?
224 Views
Last Modified: 2013-01-07
Hi

I import data into Excel from both SQL and Access and generate fairly complex charts in Excel manually.
In the past I have encountered a lot of problems using Excel VBA to automate this so I want to rather apply the imported data range to each chart.
I need a few pointers on the best way to do this so that the chart doesn't lose any of its original structure.
0
Comment
Question by:Murray Brown
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 38750126
There are different ways. If you have the imports set up as queries then using either structured references (2007 or later) or dynamic named ranges, you shouldn't really need to do anything other than refresh the queries.
Alternatively you can simply alter the data sources of the charts by looping and altering the XValues and Values properties of each series in the charts (I am assuming they are too complex for a simple SetSourceData statement).
0
 
LVL 40

Expert Comment

by:als315
ID: 38750205
0
 

Author Closing Comment

by:Murray Brown
ID: 38750420
Thanks very much
0
 

Author Comment

by:Murray Brown
ID: 38750428
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question