IIn excel, using an office script, I'm trying to copy a value from one cell in what I assume is a valid range to another. Simplified version of my code:
let selectedCell = workbook.getActiveCell();
let selectedSheet = workbook.getActiveWorksheet();
let range = selectedSheet.getUsedRange();
let visibleRange = range.getVisibleView();
let rangeValues = visibleRange.getValues(); // This doesn't fail, so I assume it's a valid range.
let rowCount = visibleRange.getRowCount();
for (let idx = 1; idx<rowCount; idx++) {
visibleRange("L"+idx).copyFrom(visibleRange("J"+idx));
}
}
I get this error:
visibleRange is not a function. (In 'visibleRange("L" + idx)', 'visibleRange' is an instance of r)
... and I am not sure why. I started with addressing the visibleRange numerically but I got the same error. Any suggestions would be helpful!
Thanks in advance.
Scott.