Skip to content

Instantly share code, notes, and snippets.

@sheetsmarts
sheetsmarts / gist:03b9c02dd7739c0140cc4a54c671214b
Created March 14, 2023 16:31
Google Drive Hacks: Duplicate Folders with Ease!
// Developed by SheetSmarts
// For tutorial, go to https://youtu.be/oA3nyYIB7V0
// To verify that the below code is safe : Copy code and paste into ChatGPT and ask it to check if the code is safe to use.
function duplicatefolder() {
// Prompt the user to enter the name of the source folder and store the value in a variable called "sourceFolderName"
var sourceFolderName = Browser.inputBox("Enter the name of the source folder:");
// Prompt the user to enter the name of the target folder and store the value in a variable called "targetFolderName"
var targetFolderName = Browser.inputBox("Enter the name of the target folder:");
@sheetsmarts
sheetsmarts / gist:ba7ba2092115b91c422faad47d7841fc
Created March 13, 2023 03:31
The Ultimate Unmerge Cells Solution for Google Sheets - Keep Values Intact!
// Developed by SheetSmarts
// For tutorial, go to https://youtu.be/1HoTd4P8wko
// To verify that the below code is safe : Copy code and paste into ChatGPT and ask it to check if the code is safe to use.
function unmergeFill() {
// Get all sheets in the active spreadsheet
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
// Loop through each sheet
for (var s = 0; s < sheets.length; s++) {
@sheetsmarts
sheetsmarts / gist:1f2122ad1b98dc938257cdcd02cb8876
Last active March 31, 2023 08:27
Generate Individual Google Sheets for Each Category in Seconds with this Time-Saving Hack!
// Developed by SheetSmarts
// For tutorial, go to https://youtu.be/osX0L4mHQ3A
// To verify that the below code is safe : Copy code and paste into ChatGPT and ask it to check if the code is safe to use.
function createSheetsFromCategoriesWithRows() {
// Get the active sheet and data range
var sheet = SpreadsheetApp.getActiveSheet();
var dataRange = sheet.getDataRange();
var data = dataRange.getValues();
@sheetsmarts
sheetsmarts / gist:7f61d07de12db34bb44cf0dfa360298d
Created March 13, 2023 03:05
Effortlessly Customize Fonts, Wrap Text, and Autofit Rows Across Multiple Google Sheets!
// Developed by SheetSmarts
// For tutorial, go to https://youtu.be/o6nCgxouQ38
// To verify that the below code is safe : Copy code and paste into ChatGPT and ask it to check if the code is safe to use.
function setFontAndResize() {
var fileIds = ["fileId1", "fileId2", "fileId3"]; // Replace with the file IDs of your files
for (var i = 0; i < fileIds.length; i++) {
var file = SpreadsheetApp.openById(fileIds[i]);
var sheets = file.getSheets();
@sheetsmarts
sheetsmarts / gist:000f6f91b651b96a4429117da04e20d7
Last active March 16, 2023 09:04
Game-Changing Seating Plan Hack for Teachers Using Google Sheets and Slides
// Developed by SheetSmarts
// For tutorial, go to https://youtu.be/HyNP4OvrgoE
// To verify that the below code is safe : Copy code and paste into ChatGPT and ask it to check if the code is safe to use.
function createButtonsInSlides() {
var presentationId = "Your presentation id"; // Replace with your presentation ID
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Sheet1");
var slide = SlidesApp.openById(presentationId).getSlides()[0]; // Assumes the button should be placed on the first slide of the presentation
@sheetsmarts
sheetsmarts / gist:c3dd6c7a0664e7d4c802521777675193
Created March 13, 2023 02:02
Automate Your Named Range Creation in Google Sheets for Lightning-Fast Results!
// Developed by SheetSmarts
// For tutorial, go to https://youtu.be/h-8P2PmYA3k
// To verify that the below code is safe : Copy code and paste into ChatGPT and ask it to check if the code is safe to use
function generateOutputAndCreateNamedRangesWithoutSheet() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getActiveSheet();
// Prompt the user to enter the column letters for class names and student names/values
@sheetsmarts
sheetsmarts / gist:abeec1fe75ee9881b79b844aac89a6b4
Last active March 13, 2023 03:08
Hide Columns across Multiple Google Sheets!
// Developed by SheetSmarts
// For tutorial, go to https://youtu.be/WJ79TNhX3ls
// To verify that the below code is safe : Copy code and paste into ChatGPT and ask it to check if the code is safe to use.
function hideColumnsInFiles() {
var spreadsheetIds = ["spreadsheetid1","spreadsheetid2","spreadsheetid3","spreadsheetid4","spreadsheetid5"]; // specify the spreadsheet IDs of the workbooks
var columnsToHide = [2, 3]; // specify the columns to hide
for (var i = 0; i < spreadsheetIds.length; i++) {