I'm looking at a way in which to name/rename a range based on an adjacent cell value that can change due to sorting/value change, etc. via VBA.
I've tried to outline an example of how the grid is laid out. This is all contained is a pre-defined table. The Yes/No columns contain the condition. If the value is Y then I want the cell to the right of it to be included in the named range.
I've had a look at various dynamic named range queries suggesting the use of OFFSET but I'm struggling to code it in a way that's getting me anywhere.
Column1 Column2 Column3 Column4
Row1 Y/N1 Balance1 Y/N2 Balance2
Row2 Y 1.000 Y 5.000
Row3 Y 2.000 N 0.000
Row4 N 0.000 N 0.000
Row5 Y 3.000 N 0.000
Row6 Y 4.000 N 0.000
B2:B3- orB2:B3;B5:B6? The former is possible with formulas, the latter only with VBA.