I thought of using afterChange hook and updating the variable. This works when the table structure does not change, however if the table structure changes - for example if I add a new row above my row - then my pointer gives me wrong cells. How can we tackle this? I want to track these cells even if new rows and columns are added between them (or above them).
Use case: I want to create charts from selected number of cells, not the entire table. But when a user adds rows or columns inside this selected range, I need to automatically update the chart.