> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 设置单元格格式

## 指令说明

**描述：** 设置Excel单元格的格式，包括字体、颜色、边框、对齐方式等。

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/setexcelcellformatcommand-01.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=c82cc1c86a5ba7a9854c1263f01e9ad4" alt="设置单元格格式指令参数面板" width="650" height="540" data-path="helpcenter/commands/excel/images/setexcelcellformatcommand-01.png" />

    | 参数           | 说明                                                         |
    | ------------ | ---------------------------------------------------------- |
    | **Excel对象**  | 请选择Excel对象（可通过指令【启动Excel】或【获取当前激活的Excel对象】创建），用于确定待操作的工作簿。 |
    | **Sheet页名称** | 操作目标工作表的名称，支持选填，默认为当前Excel激活的Sheet页。                       |
    | **单元格区域**    | 填写需要设置格式的单元格区域。                                            |
    | **字体**       | 设置字体名称、大小、颜色等。                                             |
    | **对齐方式**     | 设置水平和垂直对齐方式。                                               |
    | **边框**       | 设置单元格边框样式。                                                 |
    | **背景色**      | 设置单元格背景填充颜色。                                               |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/setexcelcellformatcommand-03.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=ed7f39d17f47d022efbbec87e4e1a2ce" alt="设置单元格格式使用示例" width="650" height="653" data-path="helpcenter/commands/excel/images/setexcelcellformatcommand-03.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/setexcelcellformatcommand-04.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=0d9ca9bbc6eb264f49a5e29d71101fd7" alt="设置单元格格式使用示例" width="569" height="476" data-path="helpcenter/commands/excel/images/setexcelcellformatcommand-04.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/setexcelcellformatcommand-02.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=5f3fc4d0f5965331cdf0041bb506c7b0" alt="设置单元格格式使用示例 - 流程搭建" width="1369" height="158" data-path="helpcenter/commands/excel/images/setexcelcellformatcommand-02.png" />

**该流程执行逻辑：**

使用【启动Excel】打开已有的Excel，并将Excel对象保存到excel对象

使用【设置单元格格式】指令设置指定单元格区域的字体、颜色、边框等格式

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/setexcelcellformatcommand-05.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=02e079915f16499198c65323069decc2" alt="设置单元格格式使用示例 - 效果展示 3" width="470" height="206" data-path="helpcenter/commands/excel/images/setexcelcellformatcommand-05.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/setexcelcellformatcommand-06.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=512d179d416b35d53cb83d6afc911fb9" alt="设置单元格格式使用示例 - 效果展示 4" width="466" height="206" data-path="helpcenter/commands/excel/images/setexcelcellformatcommand-06.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
