I need to iterate over a disjoint range that has 'A1', 'O1', 'R1:S1'
structure.
There are many workbooks, and there are many rows to iterate in respective sheet of each workbook (say, rows 21, 24, 31:35, 40 of 'Sheet1').
Is there a simple way to iterate over it with openpyxl, or other library?
At the moment I use the following for each row, which is unacceptable.
wb = openpyxl.load_workbook(filename)
sheet = wb['Sheet1']
for cellObj in sheet['A1:S2']:
for cell in cellObj:
pass
I've failed to find a tip in the documentation. May be some other library or different approach is applicable in such cases?