In my code I have a function that takes in a single cell. If the cell is part of a formula array eg: {=MyCustomFn(A2:C4)}
.
And lets say the Formuala array covers Cells D1:E4
. And now my function has get passed cell D4
.
Is is possible when only D4
is available to my function to get the rest of the cells that are part of the formula array?
def my_fn(cell: Any) -> Any:
formula = cell.getFormula()
if formula.startswith("{="):
is_formuala_array = True
else:
is_formuala_array = False
# get the cell range for the formulay array
# What goes here? How do I get the range of cells that the formula is for?