


Work faster in Google Docs and Sheets by creating your own shortcuts
Enhance Google Docs and Sheets Productivity with Scripts and Macros
This article has been updated since its original publication on November 26, 2018.
Google Drive offers more than cloud storage; it provides a powerful office suite including Docs and Sheets. While these web apps are designed for speed and ease of use, their functionality can be significantly boosted with scripts and macros.
JavaScript-based scripts add extra features. Imagine automating invoice generation in Sheets or rapidly converting Docs files to PDFs.
Macros are specialized scripts—sequences of actions triggered by a single keystroke or click. They streamline repetitive tasks, such as applying consistent formatting to large text blocks or duplicating spreadsheet rows. Mastering scripts and macros unlocks significant productivity gains.
Adding Scripts to Google Apps
Proficient JavaScript users can write their own scripts. In Docs or Sheets, navigate to Extensions > Apps Script. This opens the Apps Script editor where you can create new scripts or execute existing ones (using the Run button). Even without coding skills, you can leverage pre-built scripts.
Numerous Google app add-ons are available online. Some provide complete installation instructions, others require copying and pasting code into the script editor. Here are a few useful examples:
- Mail Merge: Populates Gmail drafts with data from a Google Sheet. Google provides guidance, but you can customize the code (e.g., adding BCC/CC recipients).
- Website Monitor: Logs website uptime/downtime, tracking load times and detecting outages. The script is embedded in a Google Sheet; simply adjust parameters (like the URL) and run.
- Invoice Generator (SheetGo): Transforms Google Sheet rows into invoices. Enter data (company details, payment amounts) into the sheet, and the script generates a PDF invoice. The code is relatively straightforward, making customization easy.
After importing scripts, manage them via the Apps Script web portal. The information icon (a circled "i") displays usage frequency. To modify a script, click on it. Always back up scripts before editing by selecting the file options (three dots) and choosing Make a copy.
While learning to code your own scripts takes time, resources like this Zapier blog post offer valuable guidance for beginners.
Creating Custom Shortcuts with Macros
Macros extend script functionality. Recording a macro generates a script automating repetitive actions, creating a mini-application for time-consuming tasks.
Currently, macros are available in Sheets but not yet in Docs or Slides. They're a long-standing feature in Microsoft Office (Word, Excel), automating formatting, data entry, and other repeated actions.
To create a Sheets macro, open a spreadsheet and go to Extensions > Macros > Record macro. The recording starts immediately. Perform your task as usual, then click Save to store it or Cancel to discard it.
During recording, choose between Use absolute references (macro runs from the same location) and Use relative references (macro runs relative to the currently selected cell). For example, use absolute references to consistently format the top row; use relative references to format cells relative to the selection.
After saving, name the macro and assign a keyboard shortcut (optional). Access and manage macros under Extensions > Macros. The Manage macros option allows renaming, re-assigning shortcuts, deleting, or viewing the code in the Apps Script editor. Examining the code helps understand the actions performed.
Google requires permission before running a macro due to potential security risks. Always verify the macro's origin before granting permission.
The above is the detailed content of Work faster in Google Docs and Sheets by creating your own shortcuts. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Windows updates are a critical part of keeping the operating system stable, secure, and compatible with new software or hardware. They are issued on a regular b

Troubleshooting The Elder Scrolls IV: Oblivion Remastered Launch and Performance Issues Experiencing crashes, black screens, or loading problems with The Elder Scrolls IV: Oblivion Remastered? This guide provides solutions to common technical issues.

Solve the UE-Sandfall game crash problem in "Clair Obscur: Expedition 33" "Clair Obscur: Expedition 33" has been widely expected by players after its release, but many players encountered the error of UE-Sandfall crashing and closing when starting the game. This article provides three solutions to help you smooth the game. Method 1: Change the startup options Change the Steam startup options to adjust game performance and graphics settings. Try setting the startup option to "-dx11". Step 1: Open the Steam library, find the game, and right-click to select "Properties". Step 2: Under the General tab, find the Startup Options section.

Solve the problem of failure of the PC version of "Clair Obscur: Expedition 33" Have you also encountered the problem that the PC version of the "Clair Obscur: Expedition 33" controller does not work properly? Don't worry, you are not alone! This article will provide you with a variety of effective solutions. "Clair Obscur: Expedition 33" has been launched on PlayStation 5, Windows and Xbox Series X/S platforms. This game is an engaging turn-based RPG that emphasizes precise timing. Its uniqueness is the perfect blend of strategic and rapid response. Smooth operation

Windows 11 KB5055528 (released on April 8, 2025) Update detailed explanation and troubleshooting For Windows 11 23H2 users, Microsoft released the KB5055528 update on April 8, 2025. This article describes the improvements to this update and provides a solution to the installation failure. KB5055528 update content: This update brings many improvements and new features to Windows 11 23H2 users: File Explorer: Improved text scaling and improved accessibility to the file opening/save dialog and copy dialog. Settings page: Added "Top Card" function to quickly view processor, memory, storage and G

Solving The Elder Scrolls IV: Oblivion Remastered Crashing Issues The Elder Scrolls IV: Oblivion Remastered, released April 22, 2025, for PS5, Xbox Series X/S, and Windows, boasts stunning visuals and improved gameplay. However, some players experien

Microsoft's Windows 10 WinRE Update Glitch: Error 0x80070643 Explained Over a year later, Microsoft is still grappling with WinRE update issues. The recent Windows 10 KB5057589 update has brought the error 0x80070643 to light. This article explores

The "Oblivion Remastered out of video memory trying to allocate a texture" error is a frustrating issue preventing players from enjoying the game. This guide provides straightforward solutions to resolve this problem. This error can occur
