Automated Google Apps Script that mirrors data and formatting from a source Google Spreadsheet to a target public/destination spreadsheet in real-time.
It preserves sheet IDs (gid) on the target spreadsheet so external references and formulas don't break.
- Real-time Tab Sync (
syncChangeToPublic): Automatically syncs changes on the active tab whenever edits, row insertions/deletions, or column changes occur. - Full Workbook Sync (
fullSpreadsheetMirrorSync): Mirrors all tabs from the source spreadsheet to the target spreadsheet. Run this manually in case the formatting gets messed up. - In-Place Updates: Updates existing sheets without deleting the tab, preserving the target sheet's unique ID (
gid). - Format & Value Copy: Copies cell values, formulas, formatting, styles, and merged cells.
- Open your Source Google Sheet.
- Go to Extensions > Apps Script.
- Paste
sync.gsinto the editor. - Replace
PUBLIC_SPREADSHEET_IDwith your target spreadsheet ID. - Save and add an
On changetrigger under the Triggers (🕒) menu forsyncChangeToPublic.