In VBA, I can assign an array to a range of cells, so that each cell in the range gets the corresponding value from the array:
Range("A1:D1").Value = Array(1, 2, 3, 4)
I tried to do the same with openpyxl:
import openpyxl
wb = openpyxl.Workbook()
ws = wb.worksheets[0]
ws.range['A1:D1'].value = [1, 2, 3, 4]
but without success.
Is there a way to do range assignment using openpyxl without iterating over each cell?
theta source
share