---
title: "Create a new Sheet tab and format a header row"
author: "Phil Bainbridge"
date: 2021-12-14T19:13:46+00:00
modified: 2021-12-14T19:13:51+00:00
canonical_url: https://pulse.appsscript.info/p/2021/12/create-a-new-sheet-tab-and-format-a-header-row/
markdown_url: https://pulse.appsscript.info/p/2021/12/create-a-new-sheet-tab-and-format-a-header-row.md
categories:
  - "Beginner"
  - "Sheets"
  - "Snippet"
  - "Solutions"
tags:
  - "pbainbridge.co.uk"
featured_image: https://pulse.appsscript.info/files/2021/12/Header-row.png
description: "Create a new Sheet tab within an existing Google Sheet file and format a header row (font size, colour, alignment, etc) for appending data to."
---

# Create a new Sheet tab and format a header row

![Create a new Sheet tab and format a header row](https://pulse.appsscript.info/files/2021/12/Header-row.png)

> Create a new Sheet tab within an existing Google Sheet file and format a header row (font size, colour, alignment, etc) for appending data to.

![Header row](https://pulse.appsscript.info/files/2021/12/Header-row.png)

Header row

The following Google Apps Script was developed as part of a larger tool for collating file information into a specifically formatted Google Sheet. As the tool was an Add-on I needed to setup the Google Sheet file in advance so that information could be later appended to it. This code:

- Checks if a particular named Sheet (tab) already exists within the Google Sheet file. If it does then it will delete the existing Sheet and create a brand new one.
- Reduce the overall number of columns within the Sheet.
- Insert 1 row of data to use as the Header row.
- Set the Header row font size, colour, weight (bold) and horizontal/vertical alignment.
- Set the Header row background colour, height and column widths.

Source: *[The Gift of Script: Create a new Sheet tab and format a header row*](https://www.pbainbridge.co.uk/2021/12/create-new-sheet-tab-and-format-header.html)

---

*Published by [Phil Bainbridge](https://pulse.appsscript.info/p/author/phillipbainbridge/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2021/12/create-a-new-sheet-tab-and-format-a-header-row/](https://pulse.appsscript.info/p/2021/12/create-a-new-sheet-tab-and-format-a-header-row/)*
