Format an Excel

Formats cells in an Excel worksheet.

Overview

This procedure formats cells in an Excel worksheet by applying various formatting options such as background color, font color, font weight, and font size to specified cell ranges.

Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

chevron-rightformat the excelhashtag

What does it do?

Begins formatting cells in the Excel file.

Where does it go?

This phrase should be written on a new line.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — A reference to the excel file must be defined in the automation.

chevron-rightthe worksheet name is "worksheet-name"hashtag

What does it do?

Specifies which worksheet to format.

Where does it go?

Indented under format the excel.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — Replace worksheet-name with the name of an existing worksheet.

Example

the worksheet name is "Sheet1"
chevron-rightthe cell range is rhashtag

What does it do?

Specifies which cells to format.

Where does it go?

Indented under format the excel.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — Replace r with a cell range (e.g., "A1:B10") or single cell (e.g., "A1").

Example

the cell range is "A1:C5"
chevron-rightthe bg color is "bg-color-code"hashtag

What does it do?

Sets the background color of the cells.

Where does it go?

Indented under format the excel.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace bg-color-code with a hex color code (without "#").

Example

the bg color is "FFFF00"
chevron-rightthe font color is "font-color-code"hashtag

What does it do?

Sets the font color of the cells.

Where does it go?

Indented under format the excel.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace font-color-code with a hex color code (without "#").

Example

chevron-rightthe font weight is "font-weight"hashtag

What does it do?

Sets the font weight/style.

Where does it go?

Indented under format the excel.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace font-weight with "bold", "italic", "underline", or "strike".

Example

chevron-rightthe font size is shashtag

What does it do?

Sets the font size in points.

Where does it go?

Indented under format the excel.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace s with a numeric value.

Example

Examples

1. Format Header Row with Background and Bold Font

Formats header cells with yellow background and bold text.

2. Format Data Column with Font Size and Color

Formats a data column with larger font size and blue color.

Last updated

Was this helpful?