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.
- 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.
-
Right-click inside the selected area.
A list of options appears.
-
Select
.
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.
-
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.
-
Click
OK.
The wizard closes.
- Repeat steps 4 and 5 for each Named Value to extract.
- Click Debug to switch to debug mode.
-
On the toolbar, click
Run.
The values appear in the results.