I'm struggling to find a solution to something I thought would have been simple. In a separate app, I'm copying an Excel workbook, running a bunch of database queries and dumping the result into the newly copied workbook, giving each result a defined name (named range).
In the Excel 'template' (it's not a real template, just a workbook being copied) there are, on another worksheet, some charts that reference the named ranges.
When I originally built the 'template' I simply inserted a chart and typed the named range in as the data source from the 'Select Data' option. The chart looked fine...
The problem is that the app that dumps the data into Excel won't always put the named ranges in the same location and the chart appears to be looking for a specific range of cells referenced (e.g. =CategoryData!$A$23:$B$29 rather than simply =nrCategoryTotals which is the named range I originally typed. ).
So the question is... Is there anyway I can get the chart to always point to the named range, even if the named range is created in a different location with the following conditions: 1. No user interaction (I realise manually moving a named range does not have this problem as Excel handles the updates) 2. The location and size of the named range will vary, only the sheet it appears on is consistent
I hope that made sense?
Al.