Bitcoin Forum
June 20, 2024, 03:24:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help: Building a custom function for Google spreadsheet to Copy/Paste Value  (Read 166 times)
manhdn (OP)
Newbie
*
Offline Offline

Activity: 62
Merit: 0


View Profile WWW
July 21, 2017, 04:03:54 PM
 #1

Hi,
I'm building a function to get Value from another cell. It will work this way:
At cell A1, I place function = copyValue(B1) or = copyValue(1 , 2) so that custom function will return the value of B1.
Here is my code:
Quote
function copyValue(int a,b) {
  var ss = SpreadsheetApp.openById('1HTEuyd7po43VKM37nmzCvPgLEVESgcN5YpAu2VRTiFI');
  var sheet =  ss.getSheetByName("Total");
  var cell = sheet.getRange(a,b);
  var c = cell.getValue();
  return(c);
}

But when I run, it said:
Quote
Missing ) after formal parameters. (line 1)

if I remove "int" before the formal params, it said I cannot getRange NULL.
Please help me to fix this. Thanks
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!