Skip to main content

Format cells

Set the number format, font, fill, alignment, wrapping and borders of a range or the selection; only the options given change, the rest of each cell's format stays.

Command in the Excel toolkit · id ooa.excel/format_cells · 15 inputs, 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
RangeStringNoCell or range to format; when empty, the range chosen by select_range or the cell chosen by go_to_cell.
Number formatStringNoExcel number format, e.g. #,##0.00, 0%, dd/mm/yyyy, @ for text or General.
BoldBooleanNoBold on or off; unchanged when empty.
ItalicBooleanNoItalic on or off; unchanged when empty.
UnderlineBooleanNoSingle underline on or off; unchanged when empty.
Font nameStringNoFont name; unchanged when empty.
Font sizeNumberNoFont size in points; unchanged when empty.
Font colorStringNoText colour: hex (#C00000), red,green,blue numbers or a name such as dark red; unchanged when empty. .xlsx only.
Fill colorStringNoSolid background colour, as for font_color; none removes the fill; unchanged when empty. .xlsx only.
HorizontalStringNoHorizontal alignment; unchanged when empty.
VerticalStringNoVertical alignment; unchanged when empty.
Wrap textBooleanNoWrap long text onto several lines; unchanged when empty.
BordersStringNoall draws thin lines around every cell; outline only around the range; none removes the lines; unchanged when empty.
SheetStringNoSheet name; active sheet when empty.
SessionStringNoexcelWorkbook session.

Outputs​

OutputTypeWhat it is
countNumberNumber of cells formatted.