Update Multiple Charts then Print to One PDF File

C

Compu Geek

I have yearly data for multiple countries stored in an Access database. I
have an Excel chart template that I import the data into to view each
country's yearly data as needed.

I need a macro to import the data for multiple countries at one time, create
an updated chart for each country, and then print all the country charts into
one PDF file.

Currently, I have a worksheet in my Excel workbook that I use to type which
ever countries I want to view in separate charts based off of the template
chart.
 
Z

Zeq

I have yearly data for multiple countries stored in an Access database
I
have an Excel chart template that I import the data into to view each
country's yearly data as needed.

I need a macro to import the data for multiple countries at one time create
an updated chart for each country, and then print all the country chart into
one PDF file.

Currently, I have a worksheet in my Excel workbook that I use to typ which
ever countries I want to view in separate charts based off of th template
chart.



You could use the following as a starting point to have all you
templates in one workbook - this is the only way I can think of to prin
to one pdf. (There are utilities available to combine several pdfs t
one, though.)



VBA Code:
--------------------


Dim country(1 To 10) As String, i As Integer

country(1) = "USA"
' define all the countries you need....

Workbooks.Add
For i = 1 To UBound(country())
Sheets.Add Type:="your_template_name.xlt", Before:=Sheets(Sheets.Count)
ActiveSheet.Name = country(i)
' here get the data in place for country(i)
' e.g.
Range("country_name").Value = country(i)
Range("data_set").QueryTable.Refresh
Next
--------------------
 

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