Openpyxl - How to read only one column from Excel file in Python?

后端 未结 8 1163
-上瘾入骨i
-上瘾入骨i 2020-12-14 18:14

I want to pull only column A from my spreadsheet. I have the below code, but it pulls from all columns.

from openpyxl import Workbook, load_workbook

wb=load         


        
8条回答
  •  时光取名叫无心
    2020-12-14 18:59

    In my opinion is much simpler

    from openpyxl import Workbook, load_workbook
    wb = load_workbook("your excel file")
    source = wb["name of the sheet"]
    for cell in source['A']:
        print(cell.value)
    

提交回复
热议问题