title: How to copy range formatting in office.js?
body: <p>Tried the following code that I pieced together from various sources but it doesn't seem to be working. Do I need to go through each individual property and assign them one by one? </p>
  
  <pre><code>Excel.run(function (ctx) {
          var worksheet = ctx.workbook.worksheets.getItem(worksheetName);
          var range = worksheet.getUsedRange();
          range.load(["formulasLocal", "address", "format/*", "format/fill", "format/borders", "format/font"]);
  
          var newWorksheet = ctx.workbook.worksheets.add(worksheetName + " -Copy");
          return ctx.sync().then(function () {
              var newAddress = range.address.substring(range.address.indexOf("!") + 1);
              newWorksheet.getRange(newAddress).values = range.formulasLocal;
              newWorksheet.getRange(newAddress).format = range.format;
          }).then(ctx.sync);
  </code></pre>