I've been googling like mad. There's plenty of info on creating charts in access reports ... but here's what I need to do.
1 Excel Workbook
1 Worksheet
1 table of data
I already have this worksheet opened via other VBA in my Access database (i've been exporting a query to the excel file and formatting the data nicely).
I need to generate a new line chart based on the data in the worksheet.
The range cannot be specified - the number of records the query returns will change, so it needs to be entirely dynamic.
It would help if I'm referring to the worksheet name as I intend on having multiple worksheets and creating a chart on each one.
To summarise:
* Instance of the relevant workbook is open
1/ Select a specific worksheet by name
2/ Find the data range (starting at A1: and ending at the last populated row/column of data)
3/ Use this range as my chart data source
4/ Generate a line chart and place it below the last row in my table (using the range found out in Step 2)
Not overly bothered about the graph being anything fancy - simple line graph with value points will do.
Row 1 will be the X axis (Date)
Rows 2 onwards will be the values and have 1 legend line each
Column A, Rows 2 onwards contains the legend names
The Y axis will be the "Total Number"
An example of the data would be:
Date_____28/01/2009____29/01/2009____30/01/2009
Stat 1____10___________20____________50
Stat 2____100__________120___________150
Stat 3____110__________220___________250
The slightest of help in getting started would be great. Am happy to do most of the leg work ;-)
Thanks.
1 Excel Workbook
1 Worksheet
1 table of data
I already have this worksheet opened via other VBA in my Access database (i've been exporting a query to the excel file and formatting the data nicely).
I need to generate a new line chart based on the data in the worksheet.
The range cannot be specified - the number of records the query returns will change, so it needs to be entirely dynamic.
It would help if I'm referring to the worksheet name as I intend on having multiple worksheets and creating a chart on each one.
To summarise:
* Instance of the relevant workbook is open
1/ Select a specific worksheet by name
2/ Find the data range (starting at A1: and ending at the last populated row/column of data)
3/ Use this range as my chart data source
4/ Generate a line chart and place it below the last row in my table (using the range found out in Step 2)
Not overly bothered about the graph being anything fancy - simple line graph with value points will do.
Row 1 will be the X axis (Date)
Rows 2 onwards will be the values and have 1 legend line each
Column A, Rows 2 onwards contains the legend names
The Y axis will be the "Total Number"
An example of the data would be:
Date_____28/01/2009____29/01/2009____30/01/2009
Stat 1____10___________20____________50
Stat 2____100__________120___________150
Stat 3____110__________220___________250
The slightest of help in getting started would be great. Am happy to do most of the leg work ;-)
Thanks.