Hi again Don,
I've re-jigged the original workbook a little, so that:
a) the worksheet names are "Data" and "Graph"
b) all non-blank data rows (not just the last year's) are included in the graph
c) the graph draws its data directly from the "Data" worksheet, not from a derived series on worksheet containing the graph.
As before, the "Data" worksheet contains one named range: "Depts", and two named formulas: "Dates" and "Data". These formulas actually define named ranges on the "Data" worksheet. The "Dates" formula is as follows:
This allows you to have up to 100 rows of data. If you need more than this, just edit the value to suit your requirements. You can be generous if you want to allow for future expansion (if you need 50 at the moment, provide for e.g. 150), but it's not considered good programming practice to include the entire worksheet (65536 rows) unless you really need them.
The "Data" formula (and therefore the "Data" named range) is derived from the "Dates" formula, the "Depts" range, and the value of the selected "Dept" in cell A1 of worksheet "Graph":
These named formulas define dynamic ranges, i.e. the defined ranges increase/decrease as data rows are added to/deleted from the "Data" worksheet. Note however that blank rows are not allowed WITHIN the ranges.
The graph takes its data from the named ranges "Dates" & "Data" - as these increase/decrease, so does the data range displayed on the graph.
Hope this helps - please let me know how you get on.
Best regards,
Greg M
Bookmarks