D
D
delongeroman2020-09-28 18:06:54
Google Apps Script
delongeroman, 2020-09-28 18:06:54

How to get a link from a cell in Google Sheets with a script?

5f71fb918e82e136936618.png

function myFunction() {
  var ss = SpreadsheetApp.getActiveSpreadsheet()
  var list = ss.getSheetByName("Тест") 
  var a = list.getRange(2, 1).getValue()
  list.getRange(3, 1).setValue(a)
  }

How can I move not just the text, but the link itself, keeping the name given in the cell? Preferably the easiest way

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Stoyanov, 2020-09-28
@delongeroman

Maybe so?

function myFunction() {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sheet = ss.getSheetByName("Тест");
  
  const value = sheet.getRange(2, 1).getRichTextValue();
  
  sheet.getRange(3, 1).setRichTextValue(value);
}

---
Maxim Stoyanov (stomaks), developer of Google Apps Script .
g-apps-script.com
stomaks.me

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question