Set range format Version 9 (Net)

Action group: Excel 


Description

The action sets the format of cells from the specified range.

Icon

Settings of parameters

Property

Description

Type

Example of filling in

Obligatory to fill in the field

Parameters

Context

Action context for working with an Excel document

Excel instance

Excel context

Yes

Start cell column name

The column name of the start cell of the range. If the field is not filled in, the value from the "Start cell column index" field is taken.

String


No

Start cell column index

Column index of the start cell (beginning of the range) from which the area will be set. If the field is not filled in, the boundary of the used area is taken.

Numeric


No

Start cell row

Row of the start cell of the range. If the field is not filled in, the boundary of the used area is taken.

Numeric


No

End cell column name

The name of the end cell column of the range. If the field is not filled in, the value from the "End cell column index" field is taken.

String


No

End cell column index

The column index of the end cell of the range. If the field is not filled in, the boundary of the used area is taken.

Numeric


No

End cell row

The area to be used is taken. If the address of the end cell is less than the address of the start cell, the area that is bounded by these cells will be used. If the address of the end cell is less than the address of the start cell, the area that is limited to these cells will be used.

Numeric


No

Format

The format to be set in the selected cells.

String


Yes

Format mask

Mask for creating a custom format. Rules for custom format masks:

1) Any custom text (kg, per, pcs, etc.) or characters (including spaces) must be enclosed in quotes.

2) You can specify several (up to 4) different format masks using semicolons. Then the first of the masks will be applied to the cell if the number in the cell is positive, the second - if it is negative, the third - if the cell content is zero and the fourth - if the cell is not a number but text.

3) 0 (zero) - one mandatory placeholder (digit), i.e. this place in the format mask will be filled with a digit from the number that the user will enter into the cell. If there is No number for this character space, zero will be output. For example, if the mask 0000 is applied to the number 12, 0012 will be output, and if the mask 0.00 is applied to the number 1.3456, 1.35 will be output.

4) # (lattice) - one optional character - roughly the same as zero, but if there is a No number for the character, nothing is outputted.

5) (space) - used as a separator of groups of digits of three between thousands, millions, billions, etc.

6) [ ] - you can specify the font color in square brackets before the format mask. The following colors are allowed: black, white, red, blue, green, yellow, light blue.

String


No

Special conditions for use

If the "To" address is smaller than the "From" address, the area that is limited to these cells will be used.

Rules for custom format masks:

  • Any custom text (kg, per, pc, etc.) or symbols (including spaces) must be enclosed in quotation marks.
  • You can specify several (up to 4) different format masks using semicolons. Then the first of the masks will be applied to the cell if the number in the cell is positive, the second if it is negative, the third if the cell content is zero, and the fourth if the cell contains text instead of a number.
  • 0 (zero) - one mandatory placeholder (digit), i.e. this place in the format mask will be filled with a digit from the number that the user will enter into the cell. If there is No number for this character space, zero will be output. For example, if the mask 0000 is applied to the number 12, 0012 will be output, and if the mask 0.00 is applied to the number 1.3456, 1.35 will be output.
  • # (lattice) - one optional character - roughly the same as zero, but if there is a No number for the character, nothing is output.
  • (space) - used as a separator of groups of digits of three between thousands, millions, billions, etc.
  • [ ] - you can specify the font color in square brackets before the format mask. The following colors are allowed: black, white, red, blue, green, yellow, cyan.

Example of use

Task

There is an Excel document with a table:

 

You need to change the format of cells in column B (from B2 to B7) from general to currency. 

Solution

Use the actions "Open", "Set range format", "Save". 

Implementation

  1. Assemble a robot scheme consisting of actions: 


  2. Configure parameters for the "Open" action. In the "Path to file" field, specify the path to the required Excel file. Check the Visible = true checkbox to display robot actions on the screen. 


  3. Set parameters for the "Set format" action. Fill in the "Context" field, specifying the context of the opened document. 
    Fill in the fields associated with columns and rows according to the range from B2 to B7, select "Currency" in the "Format" field.  


  4. Customize parameters for the "Save" action. Specify the context of the Excel document in the "Context" parameter. 


  5. Launch the robot using the "Start" button in the top panel. 

Result

The program robot completed successfully.

In the required range, changed the cell format from general to currency. 

  • Нет меток