UiPath Documentation
studiox
2020.10
false
StudioX 用户指南
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

教程:设置单元格的格式

在本教程中,我们将创建一个简单的自动化项目,以便将一种格式应用于电子表格标题行中的单元格,并将另一种格式应用于同一电子表格第一列中的单元格。我们将每种格式应用于项目的“项目笔记本”中的单元格,然后使用两个“复制范围”活动将每个单元格的格式复制到电子表格中的目标行和列。

  1. 步骤 1:设置项目并获取必要的文件

    1. Create a new blank project using the default settings.
    2. 使用此页面底部的按钮,下载并提取本教程中自动化项目的存档文件。将“DoubleUI.xlsx”文件复制到您的项目文件夹。
  2. 第 2 步:将所需的格式应用于项目笔记本中的两个单元格。

    1. 单击 StudioX 功能区中的“项目笔记本”。打开文件 Project_Notebook.xlsx

    2. 将第一列的以下格式应用于项目笔记本的 Scratchpad 工作表中的单元格 A1:

      • 填充颜色:浅蓝色
      • 带两位小数空格的数字格式
    3. 将标头行的以下格式应用于项目笔记本的 Scratchpad 工作表中的单元格 B1:

      • 填充颜色:浅灰色
      • 字体样式:粗体
    4. 保存并关闭项目笔记本。

  3. 步骤 3:将 DoubleUI.xlsx 添加到项目中,然后将格式复制到列和行中。

    此格式化将从项目笔记本文件的 Scratchpad 工作表中的两个单元格复制到 DoubleUI 文件的标头行和第一列。

    1. Click Add activity 文档图像 in the Designer panel, and then find the Use Excel File activity in the search box at the top of the screen and select it. A Use Excel File activity is added to the Designer panel.

    2. 在活动中:

      • Click Browse文档图像 next to the Excel file field, and then browse to and select the file DoubleUI.xlsx

      • 在“引用为”字段中,输入 DoubleUI

        您已指明将使用自动化中称为“DoubleUI”的文件“DoubleUI.xlsx”。

    3. In the Use Excel File activity, click Add activity 文档图像 , then find the Copy Range activity in the search box at the top of the screen and double-click it. The activity is added inside the Use Excel File activity.

    4. 在“复制范围”活动中:

      • Click Plus文档图像 on the right side of the Source range field, and then select Project Notebook (Notes) > Indicate in Excel.

      • In the Excel file, select cell A1 in the Scratchpadsheet, and then click Confirm in the UiPath tab in the Excel ribbon.

        您已指明要从项目笔记本的 Scratchpad 工作表复制 A1 单元。

      • Click Plus文档图像 on the right side of the Destination range field, and then select DoubleUI > Indicate in Excel.

      • 在 Excel 文件中,选择整个 A 列,然后在 Excel 功能区的“UiPath”选项卡中单击“确认”

        您已指明要将数据粘贴到 DoubleUI 文件的第一列中。

      • From the What to copy drop-down menu, select Formats to indicate that only the cell formatting should be copied.

    5. 在现有活动的正下方添加第二个“复制范围”活动。

    6. 在第二个“复制范围”活动中:

      • Click Plus文档图像 on the right side of the Source range field, and then select Project Notebook (Notes) > Indicate in Excel.

      • In the Excel file, select cell B1 in the Scratchpadsheet, and then click Confirm in the UiPath tab in the Excel ribbon.

        您已指明要从项目笔记本的 Scratchpad 工作表复制 B1 单元格。

      • Click Plus文档图像 on the right side of the Destination range field, and then select DoubleUI > Indicate in Excel.

      • 在 Excel 文件中,选择标头行(范围 A1:D1),然后在 Excel 功能区的“UiPath”选项卡中单击“确认”

        您已指明要将数据粘贴到 DoubleUI 文件的 A1:D1 范围中。

      • From the What to copy drop-down menu, select Formats to indicate that only the cell formatting should be copied.

    7. 要使“复制范围”活动更容易识别,请在每个活动的上部栏中编辑名称。例如第一个活动使用 Copy Format Column,第二个活动使用 Copy Format Row

    8. 在 StudioX 功能区中单击“保存”,以保存自动化,然后单击“运行”来执行此自动化。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新