Relative Content

Tag Archive for javascriptloopsfor-loopoffice365office-js

ExcelScript / Office360/ Javascript : Loop copies range 4 times instead of adjustedN

I’m working with ExcelScript and encountering an issue with a loop that copies a range of cells. The loop is intended to copy the range adjustedN times, where adjustedN is calculated as Math.floor((numberOfPages – 16) / 2). However, the loop always copies the range 4 times regardless of the calculated value of adjustedN. I don’t know how to fix it, because the calculation is correct.