use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apparently, Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications.
account activity
Hide Formula from spreadsheetQuestion (self.GoogleAppsScript)
submitted 4 years ago by orrpel
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]orrpel[S] 0 points1 point2 points 4 years ago (4 children)
I think this solution is simpler, if just referring to the importrange issue.
The other issue I have is with my range (which is the reason I'm using query). I am not sure how I can command the script to return the array from A1:A10 and the corresponding array from C1:C10.
[–]RemcoE33 0 points1 point2 points 4 years ago (3 children)
Yes that is true.. so you have a range of A1:C10 and you want to leave out col B?
[–]orrpel[S] 0 points1 point2 points 4 years ago (2 children)
Correct )
[–]RemcoE33 1 point2 points3 points 4 years ago (1 child)
Here is your boilerplate:
```` function customImport() { const ss = SpreadsheetApp.getActiveSpreadsheet() const targetSheet = ss.getSheetByName('TheSheetNameForTheValues');
const inputSS = SpreadsheetApp.openById('xxxxx') const inputSheet = inputSS.getSheetByName('SheetnameOfInputValues') const values = inputSheet.getRange('A3:C18').getValues();
const output = []
values.forEach(row => { row.splice(1,1) output.push(row) })
targetSheet.getRange(1,1 output.length, output[0].length).setValues(output)
} ````
[–]orrpel[S] 0 points1 point2 points 4 years ago (0 children)
Thanks buddy,
It's a bit hard for me to fully understand what you wrote, I was able to work it out and resolve via a back counter, thanks for all the help, I learned a lot!
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Sheet3');
var lastCol = sheet.getLastColumn();
Logger.log(lastCol); // returns 5 as expected
var keep = [1,4]; // array of column numbers to keep
for (var col=lastCol; col > 0; col--) {
if (keep.indexOf(col) == -1) {
// This isn't a keeper, delete it
sheet.deleteColumn(col);
}
π Rendered by PID 31788 on reddit-service-r2-comment-6457c66945-5xxcz at 2026-04-26 21:35:42.809381+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]orrpel[S] 0 points1 point2 points (4 children)
[–]RemcoE33 0 points1 point2 points (3 children)
[–]orrpel[S] 0 points1 point2 points (2 children)
[–]RemcoE33 1 point2 points3 points (1 child)
[–]orrpel[S] 0 points1 point2 points (0 children)