Set Cell Values

Updates the values in an Excel file for one or more cells.

Overview

This procedure updates the contents of one or more specific cells in an Excel file. You specify the worksheet, the target cell references (e.g., "A1", "B2"), and the new values for the cells.

Syntax

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

set the cell values in the excel

What does it do?

Begins updating cell values 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 must be defined in the automation.

the worksheet name is "worksheet-name"

What does it do?

Specifies which worksheet to update.

Where does it go?

Indented under set the cell values in 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 "Data"
the cell references are "A1", "B2", "C3" ...

What does it do?

Specifies which cells to update.

Where does it go?

Indented under set the cell values in the excel.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — Replace A1, B2, C3, etc. with a list of cell references in Excel format.

Example

the cell references are "A1", "B2", "C3"
the cell values are "value1", "value2", "value3"

What does it do?

Specifies the new values for the cells.

Where does it go?

Indented under set the cell values in the excel.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — Replace value1, value2, value3 with a list of values. Must match the number of cell references.

Example

the cell values are "John", "25", "Engineer"

Examples

1. Update Header Cells

Updates header cells with column names.

set the cell values in the excel
    the worksheet name is "Employee Data"
    the cell references are "A1", "B1", "C1"
    the cell values are "Name", "Age", "Department"

2. Update Status Cells

Updates status information in specific cells.

set the cell values in the excel
    the worksheet name is "Project Status"
    the cell references are "C9", "C12", "J2"
    the cell values are "Completed", "In Progress", "Pending"

Last updated

Was this helpful?