I want to assign the below list to a range of cells using OpenPYXL.
quarters = ['Q1', 'Q2', 'Q3', 'Q4']
I used the below to assign one value over a range, which worked fine.
for col in cpcp.iter_cols(min_row=2, max_row=3, min_col=23, max_col=55):
for cell in col:
cell.value = 'P'
However, I tried the below code with a List...
quarters = ['Q1', 'Q2', 'Q3', 'Q4']
for col in cpcp.iter_cols(min_row=4, max_row=4, min_col=23, max_col=54):
for col, value in enumerate(quarters):
cell.value = quarters
I'm getting the below error:
ValueError: Cannot convert ['Q1', 'Q2', 'Q3', 'Q4'] to Excel
Below is a snippet of what I'm trying to acheive:
Thanks for your help!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…