Skip to main content

Using Apps Script to Automate Tasks in Google Sheets

Using Apps Script to Automate Tasks in Google Sheets

Using Apps Script to Automate Tasks in Google Sheets

Google Apps Script is a powerful tool that lets you write code to automate tasks in Google Sheets. Whether you're sending emails, organizing data, or connecting with other Google services, Apps Script helps you supercharge your spreadsheets.

๐Ÿš€ What is Google Apps Script?

Google Apps Script is a cloud-based scripting language for light-weight application development. Based on JavaScript, it allows you to automate actions across Google Workspace apps like Sheets, Docs, Gmail, Calendar, and more.

⚙️ How to Access Apps Script in Google Sheets

  1. Open any Google Sheet.
  2. Click Extensions > Apps Script.
  3. This opens the Script Editor in a new tab where you can start coding.

๐Ÿงช Your First Script: Auto Timestamp

This simple script adds a timestamp in column B whenever a value is entered in column A.

function onEdit(e) {
  var sheet = e.source.getActiveSheet();
  var range = e.range;
  if (range.getColumn() == 1 && range.getValue() !== '') {
    sheet.getRange(range.getRow(), 2).setValue(new Date());
  }
}

๐Ÿ“จ Automate Email Alerts

You can also use Apps Script to send email notifications when a condition is met. Example: Notify when a task is marked as "Done".

function sendEmailOnDone() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var data = sheet.getDataRange().getValues();
  for (var i = 1; i < data.length; i++) {
    if (data[i][2] == "Done") {
      MailApp.sendEmail("you@example.com", "Task Completed", "Task " + data[i][0] + " is done.");
    }
  }
}

๐Ÿ“š Resources to Learn More

๐Ÿ“„ Download Tutorial PDF

Download this guide as PDF


Tags: google sheets automation, google apps script, automate google sheets, productivity with sheets, spreadsheet automation

Comments

Popular posts from this blog

How to activate office 2016 using script ??

How to activate office 2016 using script ?? 1. Copy the following script in notepad and save as .bat . 2. Run the bat file as administrator. @echo off title Permanently Activate Office 365 ProPlus for FREE - Somethingos.blogspot.incom&cls&echo ============================================================================&echo #Project: Activating Microsoft software products without software&echo ============================================================================&echo.&echo #Supported products: Office 365 ProPlus (x86-x64)&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16...

How to break Windows password using Ubuntu?

How to break Windows password using Ubuntu? 1. Boot machine with Ubuntu and run as live. 2. Open Terminal, set root password and switch user as root in terminal. 3. Install  chntpw   graphically or by using command           #apt-get install chntpw                       or           #apt install chntpw 4. Create a directory with any name.           #mkdir /abc 5. Mount C drive to abc directory.             #ntfs-3g mount /dev/sda1 /abc -o force 6. locate sam file             #cd /abc/Windows/System32/config 7. use command:             #chntpw -l                   //to list users             #chntpw -u administrator sa...

How to Bypass windows password on logon screen?

How to Bypass windows password on logon screen? Kon-Boot  is an application which will silently bypass the authentication process of Windows based operating systems. Without overwriting your old password! In other words you can login to your Windows profile without knowing your password. Easy to use and excellent for tech repairs, data recovery and security audits. Steps  : 1. Download kon-boot from here . 2. Extract in a folder and connect a USB pendrive. 3. Right click on usb_install-RUNASADMIN and run as administrator. 4. Here is your USB ready and boot the system. 5. Leave password blank and press enter. you will find system log on.