Using JavaScript on the Google docs spreadsheet

Can someone help me with a JavaScript that will copy the values of I 20 in J 20 in the Google document, spreadsheet, and then paste the contents of the buffer and I 21 in J 21.
dwcroninAsked:
Who is Participating?
 
leakim971Connect With a Mentor PluritechnicianCommented:
You just need this :
function myFunction() {
  var mysheet = SpreadsheetApp.getActiveSpreadsheet();
  var source_range = mysheet.getRange("I20:J20");
  var target_range = mysheet.getRange("I21:J21");
  source_range.copyTo(target_range);
}

Open in new window

0
 
dwcroninAuthor Commented:
Please tell me how to put your function in my spreadsheet.  I'm new to making functions in my spreadsheet and I forget how they are created.
0
 
leakim971PluritechnicianCommented:
When you're on your spreadsheet go to : Insert -> Script
"Follow" the wizard

On the Script Editor window
Copy/Paste
Go to : Resources -> Current Trigger (no sure about the translation, I'm french)
Click on : Click to add one
Choose your function and how you want to trigger it (last one should be after an update)

You can easily found multiple video on youtube if needed :
http://www.youtube.com/results?search_query=trigger+script+google+spreadsheet&oq=trigger+script+google+spreadsheet
0
 
dwcroninAuthor Commented:
Can you just paste just the CONTENTS of the buffer?  Right now it is also copying the FORMATTING.
0
 
leakim971PluritechnicianCommented:
no
0
All Courses

From novice to tech pro — start learning today.