Get number of rows Version 2 (Python)

Action group: Office


Description

Action returns the number of rows of the specified column

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for ods/xlsx documentRobin.OpenSheetD oc
Yes
ColumnThe name of the column whose row count is to be retrieved. Only those rows that are included in the used area are taken into account when countingRobin.String
Yes
Skip empty cellsCount rows only with filled cells in the specified columnRobin.BooleantrueNo
Results
ResultNumber of rows in the specified columnRobin.Numeric

Special conditions of use

None.

Example of use

Task

There is a file Book1.xlsx, I need to get the number of filled rows in column A, save and close the document. 

Solution

Use the actions "Open", "Get number of rows", "Save", "Close".

Implementation

  1. Move the "Open" action to the workspace and set its parameters
    In the "Path to file" field specify the path to the file Book1.xlsx




  2. Move the "Get number of rows" action to the workspace and fill in its parameters
    In the "Context" field, specify the context created in step 1.
    In the "Column" field specify the value = A.
    In the "Skip empty cells" field specify a check mark.
    In the "Result" field specify the variable "Number", having created it in advance. 

  3. Move the "Save" action to the workspace and set its parameter.
    In the "Context" field specify the context of the opened document.

  4. Move the "Close" action to the workspace and set its parameter.


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

Result

The program robot completed successfully.

The number of filled rows of column A is successfully written to the variable "Number".

The file is saved and closed. 


  • Нет меток