Search code examples
pythonxlwings

is there a way to write in cells vertically via xlwings?


I want to organize the (split)ed result vertically like this

not this

import xlwings as xw
wb = xw.Book()
ws = wb.sheets.active
result = "1,2,3,4,5,6,7"
ws.range(1,1).value = result.split(",")

Solution

  • The xlwings tutorial says:

    To write a list in column orientation to Excel, use transpose:

    sht.range('A1').options(transpose=True).value = [1,2,3,4]