Assign multiple values in range

Viewed 3959

In VBA I can assign array to range of cells, so that every cell in range gets corresponding value from the array:

Range("A1:D1").Value = Array(1, 2, 3, 4)

I was trying 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 with openpyxl without iterating every cell?

1 Answers
Related