如何使用多行多列的openpyxl打印excel单元格的值?

时间:2017-01-28 08:24:31

标签: python-2.7

from openpyxl import Workbook,load_workbook

s1="test2.xlsx"

wb = load_workbook(s1)
index1 = wb.get_sheet_by_name("Sheet1")
rownum=3

for row_i in range(3,21):
    for col_i in range(3,21):
        no=(index1.cell(row=row_i,column=col_i))
        print no

wb.save(s1)

0 个答案:

没有答案