본문 바로가기
프로그래밍 관련/파이썬 액셀제어(openpyxl)

openpyxl. Row, Column 읽어오기

by 존버매니아.임베디드 개발자 2023. 9. 27.
반응형
from openpyxl import Workbook
from openpyxl import load_workbook

#user 
filename=""

if filename=="":
    file = Workbook()
else:
    file = load_workbook(filename)

sheet=file.active

#load column
colC = sheet['C']
col_range = sheet['C:D']

#load Row
row10 = sheet[10]
row_range = sheet[5:10]

#load ranges
cell_range = sheet['A1':'C2']

file.close()
반응형