Error while running script

7 views
Skip to first unread message

Abhishek Waghmare

unread,
Jun 24, 2022, 9:06:03 AMJun 24
to Google Apps Script Community
Hey,

I'm trying to run script which can autofill column whenever sheet gets new entry in sheet. able to run basic formulas with the same script but getting error when i'm using importrange with it. Please suggest




function myfunction() {
  var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();

  var lr = ss.getLastRow();
  var fillDownRange = ss.getRange(3,3,lr-1);
  ss.getRange ("C3").copyTo(fillDownRange);
}


Thankyou
Abhishek Waghmare

Jonathan Butler

unread,
Jun 24, 2022, 11:15:43 AMJun 24
to google-apps-sc...@googlegroups.com
What error are you getting?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/37de26b3-c34e-4f8c-bebf-e5abdc5fdb5cn%40googlegroups.com.

Abhishek Waghmare

unread,
Jun 24, 2022, 11:20:04 AMJun 24
to google-apps-sc...@googlegroups.com
Syntax error missing ) after argument list line :3 file

You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/ZT6uQ8KOSoo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CAE9k5yB6qxFuxUL_DtbavBqok-EOyQRYkLGR%2BYuOCL9UOAJ4rQ%40mail.gmail.com.
Screenshot_2022-06-24-20-48-17-94_6012fa4d4ddec268fc5c7112cbb265e7.jpg
Screenshot_2022-06-24-20-48-05-87_6012fa4d4ddec268fc5c7112cbb265e7.jpg

Jonathan Butler

unread,
Jun 24, 2022, 11:25:17 AMJun 24
to google-apps-sc...@googlegroups.com
I didn't notice the screenshots initially, my bad. It's the quotation marks. When dealing with nested quotations marks, you need to either escape the inner quotation marks, or use different quotation marks outside of the inner quotation marks. Change the double quotation marks in the setFormula function to single quotation marks on the outside.

From this
To this

Abhishek Waghmare

unread,
Jun 24, 2022, 11:27:47 AMJun 24
to google-apps-sc...@googlegroups.com
Ok ok..

Thanks man 👍

Let me check if it's working.

Reply all
Reply to author
Forward
0 new messages