トップ 履歴 一覧 Farm ソース 検索 ヘルプ PDF RSS ログイン

openpyxl

*disclaimer
636477

[Python]

openpyxl



  • 特定のカラムの値を出力する
import openpyxl

wb = openpyxl.load_workbook('ファイル名')
ws = wb['シート名']
for row in ws.iter_rows(min_col=カラム番号, max_col=カラム番号):
    for col in row:
        print(col.value)

wb.close()
  • カラムは、普通、アルファベットなのに、番号で指定しないといけないのが面倒