TobiasH
TobiasH

Reputation: 313

Google Spreadsheets: Show Document URL in cell. Possible?

Simple Question: I would like to get the URL of the active Document (google spreadsheet) in a specific cell.

So if I enter =GetUrl() in A1 of https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXXXXXXXXXXX&usp=drive_web#gid=16

should give me the result https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXXXXXXXXXXX&usp=drive_web#gid=16 in the cell A1

Upvotes: 4

Views: 2148

Answers (1)

wchiquito
wchiquito

Reputation: 16551

A function like this might be useful:

function GetUrl() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  return ss.getUrl();
}

enter image description here

Check: Class Spreadsheet - getUrl()

Upvotes: 4

Related Questions