In this tutorial, we will create a simple automation that applies one format to the cells in the header row of a spreadsheet and another format to the cells in the first column of the same spreadsheet. We will apply each format to a cell in the project's Project Notebook, and then use two Copy Range activities to copy the format of each cell to the intended row and column in our spreadsheet.
Step 1: Set up the project and get the necessary files
- Create a new blank project using the default settings.
- Download and extract the archive with the automation project in this tutorial using the button at the bottom of this page and copy the file DoubleUI.xlsx to your project folder.
Step 2: Apply the desired formats to two cells in the Project Notebook.
- Click Project Notebook in the StudioX ribbon. The file Project_Notebook.xlsx is opened.
- Apply the following format for the first column to cell A1 in the Scratchpad sheet of the Project Notebook:
- Fill Color: Light Blue
- Number format with two decimal spaces
- Apply the following format for the header row to cell B1 in the Scratchpad sheet of the Project Notebook:
- Fill Color: Light Gray
- Font Style: Bold
- Save and close the Project Notebook.
Step 3: Add DoubleUI.xlsx to the project and copy the formats to the column and row.
- 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.
- In the activity:
- Click Browse next to the Excel file field, and then browse to and select the file
DoubleUI.xlsx
- In the field Reference as, enter
DoubleUI
.
You have indicated that you will work on the file DoubleUI.xlsx that is known in your automation as DoubleUI.
- Click Browse next to the Excel file field, and then browse to and select the file
- 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.
- In the Copy Range activity:
- 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 Scratchpad sheet, and then click Confirm in the UiPath tab in the Excel ribbon.
You have indicated that you want to copy the A1 cell from the Scratchpad sheet of the Project Notebook. - Click Plus on the right side of the Destination range field, and then select DoubleUI > Indicate in Excel.
- In the Excel file, select the entire column A, and then click Confirm in the UiPath tab in the Excel ribbon.
You have indicated that you want to paste the data to the first column in the DoubleUI file. - From the What to copy drop-down menu, select Formats to indicate that only the cell formatting should be copied.
- Add a second Copy Range activity just below the existing one.
- In the second Copy Range activity:
- 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 Scratchpad sheet, and then click Confirm in the UiPath tab in the Excel ribbon.
You have indicated that you want to copy the B1 cell from the Scratchpad sheet of the Project Notebook. - Click Plus on the right side of the Destination range field, and then select DoubleUI > Indicate in Excel.
- In the Excel file, select the header row (range A1:D1), and then click Confirm in the UiPath tab in the Excel ribbon.
You have indicated that you want to paste the data to the range A1:D1 in the DoubleUI file. - From the What to copy drop-down menu, select Formats to indicate that only the cell formatting should be copied.
- To make the Copy Range activities more easily identifiable, edit the name in the upper bar of each one. For example, use
Copy Format Column
for the first,Copy Format Row
for the second.
- Click Save in the StudioX ribbon to save the automation, then click Run to execute the automation.
The formatting is copied from the two cells in the Scratchpad sheet of the Project Notebook file to the header row and first column of the DoubleUI file.
Updated 2 years ago
See Also
Tutorials |