i'm converting a VBA Macro to a Excel Script in order to run a macro at Excel Web
The VBA Code:
//Parameters is a Sheet who has startCol/endCol Cell number and startRow/endRow numbers
// Cells 3,4 is startCol; Cells 3,5 is endCol
// Cells 3,2 is startRow; Cells 3,3 is endRow
For column = Sheets("Parameters").Cells(3,4) To Sheets("Parameters").Cells(3,5)
For row = Sheets("Parameters").Cells(3,2) To Sheets("Parameters").Cells(3,3)
//then it scan the Projects Sheet and erase the values
Sheets("Projects").Cells(row, column) = ""
Next row
Next column
How can I convert this to a nested loop in Javascript/Excel Script?
I've tried something like:
let usedRange = workbook.getWorksheet("Parameters").getRange("O5:GW40");
let rowCount = usedRange.getRowCount();
let columnCount = usedRange.getColumnCount();
for(let i = 1; i< columnCount; i++){
for(let j = 1; j < rowCount; j++){
if (usedRangeValues[i][j] != ""){
usedRangeValues[i][j].setValue("");
}
}
}
But i'm not getting any step further...