Skip to content

Instantly share code, notes, and snippets.

Last active Jun 10, 2021
What would you like to do?
Create a new snippet from a blank template.
name: EX 2
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
content: |
const form = document.getElementById("run") as HTMLFormElement;
form.addEventListener("click", async (event) => {
await (context) => {
const sheet = context.workbook.worksheets.getFirst();
const colunA = sheet.getRange("A1").getExtendedRange("Down");
colunA.load(["values", "rowCount"]);
await context.sync();
const forumla = [];
for (let i = 0; i < colunA.rowCount; i++) {
const v = colunA.values[i][0];
const quadra = v * v;
const raiz = Math.sqrt(v);
forumla.push([quadra, raiz]);
const qer = sheet.getRange(`B1:C${colunA.rowCount}`);
qer.values = forumla;
await context.sync();
language: typescript
content: "<form id=\"run\">\n\t<button>Executar</button>\n\t</div>"
language: html
content: ''
language: css
libraries: |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment