Get value from each cell of a Range.Areas

Maza, Mario 1 Reputation point
2021-09-19T02:44:00.423+00:00

Get value from each cell of a Range.Areas

I am in the process of learning.
I have tried the following, but I would like a more effective suggestion on how to get the values from a RangeAreas and paste them into a table.
Thanks in advance

async function main(mybook: ExcelScript.Workbook)
{

let MyHoja = mybook.getWorksheet("Hoja1");

let RCell = MyHoja.getRanges("D15, D17, D19, D21, I23, O23, A59");

var vRCell = RCell.getAreas();

var i:number=0

let vRCell1 = vRCell.forEach((value, i) => {
let AreaDAT = vRCell[i];

MyHoja.getCell(29, i).setValue(AreaDAT);


i = i + 1;

});

}

Microsoft 365 and Office | Development | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. jeremy-msft 11 Reputation points Microsoft Employee Moderator
    2021-09-23T17:18:06.833+00:00
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.