Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

excel cell add

zmworm edited this page Apr 16, 2026 · 53 revisions

Excel: Cell - add

Add cells with values, formulas, and formatting.

Path: /{SheetName}

Properties

Property Default Description
ref (auto) Cell reference (e.g., A1). If omitted, auto-assigns next available cell in row 1
value Cell value
formula Formula (e.g., =SUM(A1:A10))
type auto string/str, number/num, boolean/bool, date
(style keys) See Cell set for style properties

Notes

  • Formula auto-detect: A value starting with = is automatically treated as a formula — no need for a separate formula property. For example, value="=SUM(A1:A10)" works identically to formula="=SUM(A1:A10)".
  • Formula prefix: Leading = sign is automatically stripped from the formula property (e.g., formula="=SUM(A1:A10)" works the same as formula="SUM(A1:A10)").
  • Boolean normalization: type=boolean converts true/yes/1 to 1, and false/no/0 to 0.
  • Auto-ref: Adding a cell without ref auto-assigns the next available cell in row 1.

Examples

officecli add data.xlsx /Sheet1 --type cell --prop ref=A1 --prop value="Hello"
officecli add data.xlsx /Sheet1 --type cell --prop ref=B1 --prop formula="=SUM(A1:A10)"
officecli add data.xlsx /Sheet1 --type cell --prop ref=C1 --prop value=100 --prop type=number --prop bold=true --prop fill=FFFF00

Row add

Inserts a row at the specified index. Existing rows at or below the index automatically shift downward. Merge cells, conditional formatting, data validations, AutoFilter references, and named ranges are all updated.

Property Default Description
cols Number of empty cells to create in the row

Use --index N to specify insertion position (1-based). Omit to append.

officecli add data.xlsx /Sheet1 --type row --index 3
officecli add data.xlsx /Sheet1 --type row --index 3 --prop cols=5

Column add

Inserts a column at the specified position. Existing columns at or after the insert position shift right. Merge cells and named ranges are updated.

Property Default Description
width Column width (characters)

Use --index N (1-based number) or --prop name=C (column letter) to specify the insert position. Both forms are equivalent.

# Insert column at position 3 (shifts existing column C → D)
officecli add data.xlsx /Sheet1 --type col --index 3
# Insert column by letter name
officecli add data.xlsx /Sheet1 --type col --prop name=C
# Insert column with custom width
officecli add data.xlsx /Sheet1 --type col --index 2 --prop width=20

Note: Excel's native path notation (Sheet1!A1, Sheet1!A:A, Sheet1!1:1) is also accepted as an alias for the DOM-style paths (/Sheet1/A1, /Sheet1/col[A], /Sheet1/row[1]).


Based on OfficeCLI v1.0.48

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /