According to the source code, if you don't pass range_string
, then iter_rows
will read all cols and rows in the sheet. In other words, row_offset
will take effect if range_string
is provided.
For example:
from openpyxl import load_workbook
wb = load_workbook('test.xlsx', use_iterators=True)
ws = wb.get_sheet_by_name('Sheet1')
# printing coordinates of all rows and cols
for row in ws.iter_rows(row_offset=2):
for cell in row:
print cell.coordinate
# printing coordinates from "A3:E5" range
for row in ws.iter_rows(range_string="A1:E3", row_offset=2):
for cell in row:
print cell.coordinate