I know how to select a cell range in Openpyxl:
cell_range = sheet['A1':'C3']
How can I paste cell_range above to another range, like sheet['A11':'C13']?
I know how to select a cell range in Openpyxl:
cell_range = sheet['A1':'C3']
How can I paste cell_range above to another range, like sheet['A11':'C13']?
I don't think there is a slicing notation exactly as described in your example, mostly because openpyxl uses lists of Cells rather than lists of plain values.
Here is the basic flow I would use to grab just a part of a sheet.
>>> wb = openpyxl.load_workbook(file_name)
>>> sheet = wb.worksheets[0]
>>> rows = sheet.rows[1:3] # slice rows
>>> foobar = [cell.value for row in rows for cell in row[3:10]] # slice row
EDIT: From this question it looks like you can do something like this:
foo = [row[start_col:end_col] for row in sheet.rows[start_row:end_row]]
Which will give you a list of lists of cells. Remember to use foo[i][j].value to get the contents of a cell.
You might want to look at this snippet for some ideas. Please note it is entirely unsupported.