I thought I finally figured this out using the information here: http://www.mrexcel.com/forum/excel-questions/692415-sparkline-dynamic-range.html, but I can't get the named range to stick as the sparkline range.
I'm trying to create sparklines for data in a pivot table that can have a variable height and width. I've successfully created named ranges using OFFSET, COUNT, and COUNTA that update dynamically when the pivot table range changes.
My data ranges are:
Name: PCBSAYPivotTableRange
Formula: =OFFSET($C$5,0,0,COUNTA($B$5:$B$1000),COUNTA($C$4:$AA$4))
Name: PCBSAYSparklineRangeForumla: =OFFSET($A$5,0,0,COUNTA($B$5:$B$1000),1)
When I set the sparkline group data range and location to PCBSAYPivotTableRange and PCBSAYSparklineRange respectively, it works! However, when I edit the sparkline data range again, PCBSAYPivotTableRange and PCBSAYSparklineRange are replaced by the actual data range (e.g. $C$5:$D$118 and $A$5:$A$118). While the named ranges properly update when the pivot table changes, the names I've created to be dynamic change to static ranges in the sparkline data range and location range. How can I get the sparklines to maintain my named range and actually be dynamic?
I'm trying to create sparklines for data in a pivot table that can have a variable height and width. I've successfully created named ranges using OFFSET, COUNT, and COUNTA that update dynamically when the pivot table range changes.
My data ranges are:
Name: PCBSAYPivotTableRange
Formula: =OFFSET($C$5,0,0,COUNTA($B$5:$B$1000),COUNTA($C$4:$AA$4))
Name: PCBSAYSparklineRangeForumla: =OFFSET($A$5,0,0,COUNTA($B$5:$B$1000),1)
When I set the sparkline group data range and location to PCBSAYPivotTableRange and PCBSAYSparklineRange respectively, it works! However, when I edit the sparkline data range again, PCBSAYPivotTableRange and PCBSAYSparklineRange are replaced by the actual data range (e.g. $C$5:$D$118 and $A$5:$A$118). While the named ranges properly update when the pivot table changes, the names I've created to be dynamic change to static ranges in the sparkline data range and location range. How can I get the sparklines to maintain my named range and actually be dynamic?