Loop in Excel

Looping in Excel is in many ways similar to looping in HTML, but much simpler due to the simpler structure of Excel. Essentially you may loop over all the sheets in a document or you may loop over the cells of a sheet either by looping over the rows, columns or cells of a found range. To loop in Excel you use the Loop in Excel step. This step has many options in common with steps that loop in HTML, such as "First index" and "increment," which are described in detail in the reference documentation.

You can insert a loop step that loops through all the rows in a table.

  1. In the "Using a robot which loads from an Excel document," click the upper left corner of the Excel view to select the entire spreadsheet.
  2. Right-click inside the selected area.

    A list of options appears.

  3. Select Loop > Loop Table Rows > Exclude First Row.

    This excludes the header row of the spreadsheet from the search. The Loop in Excel step now sets the first cell in the loop as the named range.

    It is now possible to extract from the named range, and because of the loop, corresponding values are extracted from the other rows.

  4. Right-click the top cell in a column just below the header and select the information to extract. For example, to extract a series of identifies, right-click the first cell in the ID column and select Extract, Extract Number, ID.

    A wizard appears with the Format Pattern correctly configured.

  5. Click OK.

    The wizard closes.

  6. Repeat steps 4 and 5 for each Named Value to extract.
  7. Click Debug to switch to debug mode.
  8. On the toolbar, click Run.

    The values appear in the results.

    See the Excel tutorial for more information.