InfrequentVisitor
New Member
- Joined
- Mar 30, 2016
- Messages
- 28
- Office Version
- 365
- 2016
- Platform
- Windows
Hello,
The Background:
I'm currently working with a pivot that is drawing information from a query. The query's number of rows change, so the pivot's does, as well. The number of columns won't change anytime soon.
The pivot is located in the CBPivot tab. I'm using Index/Match to pull the information from the pivot into a cell:
=INDEX(CBPivot!$B$3:$BP$11803,MATCH($C30,CBrow,0),MATCH(F$29,CBcolumn,0))
Where CBrow & CBcolumn are offset functions to adjust the row & column references as the pivot changes size.
CBrow = OFFSET(CBPivot!$A$3,0,0,COUNTA(CBPivot!$A:$A)-1,1)
CBcolumn = OFFSET(CBPivot!$B$2,0,0,1,COUNTA(CBPivot!$2:$2)-1)
The Question:
Is there a way (preferably with formulas over VBA, but I'll use VBA, if needed) to make the array reference CBPivot!$B$3:$BP$11803 in the INDEX function dynamic, so that it changes with the pivot's size?
- Thank you
The Background:
I'm currently working with a pivot that is drawing information from a query. The query's number of rows change, so the pivot's does, as well. The number of columns won't change anytime soon.
The pivot is located in the CBPivot tab. I'm using Index/Match to pull the information from the pivot into a cell:
=INDEX(CBPivot!$B$3:$BP$11803,MATCH($C30,CBrow,0),MATCH(F$29,CBcolumn,0))
Where CBrow & CBcolumn are offset functions to adjust the row & column references as the pivot changes size.
CBrow = OFFSET(CBPivot!$A$3,0,0,COUNTA(CBPivot!$A:$A)-1,1)
CBcolumn = OFFSET(CBPivot!$B$2,0,0,1,COUNTA(CBPivot!$2:$2)-1)
The Question:
Is there a way (preferably with formulas over VBA, but I'll use VBA, if needed) to make the array reference CBPivot!$B$3:$BP$11803 in the INDEX function dynamic, so that it changes with the pivot's size?
- Thank you