I cannot figure out how to iterate through all rows in a specified column with openpyxl.
I want to print all of the cell values for all rows in column "C"
Right now I have:
from openpyxl import workbook
path = 'C:/workbook.xlsx'
wb = load_workbook(filename = path)
ws=wb.get_sheet_by_name('Sheet3')
for row in ws.iter_rows():
for cell in row:
if column == 'C':
print cell.value
Why can't you just iterate over column 'C' (version 2.4.7):
for cell in ws['C']:
print cell.value