{"id":50,"date":"2026-02-09T11:10:55","date_gmt":"2026-02-09T03:10:55","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=50"},"modified":"2026-01-17T05:45:17","modified_gmt":"2026-01-17T05:45:17","slug":"how-to-write-python-list-data-to-excel-worksheet-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-write-python-list-data-to-excel-worksheet-using-xlwings\/","title":{"rendered":"How To Write Python List Data to Excel Worksheet Using xlwings?"},"content":{"rendered":"<h2>Method<\/h2>\n<h3><b>Write rows<\/b><\/h3>\n<p>#xlwings<\/p>\n<p>lst=[1,2,3,4,5]<\/p>\n<p>sht.range(&#8216;A1&#8217;).value=lst\u00a0\u00a0\u00a0 #Write Python data to Excel worksheet<\/p>\n<p>#Or<\/p>\n<p>#lst=[1,2,3,4,5]<\/p>\n<p>#sht.range(&#8216;E1&#8217;).options(transpose=True).value=lst\u00a0\u00a0\u00a0 #Transpose<\/p>\n<p>\u00a0<\/p>\n<p>#xlwings API<\/p>\n<p>#lst=[[1],[2],[3],[4],[5]]<\/p>\n<p>#sht.api.Range(&#8216;C1:C5&#8217;).Value=lst\u00a0\u00a0\u00a0 #Write directly<\/p>\n<p>#Or<\/p>\n<p>#lst=[1,2,3,4,5]<\/p>\n<p>#sht.api.Range(&#8216;E1:E5&#8217;).Value=app.api.WorksheetFunction.Transpose(lst)\u00a0\u00a0\u00a0 #Transpose<\/p>\n<p>\u00a0<\/p>\n<h3><b>2D data<\/b><\/h3>\n<p>#xlwings<\/p>\n<p>#sht.range(&#8216;A5:B6&#8217;).value=[[1,2],[3,4]]<\/p>\n<p>#sht.range(&#8216;A1&#8242;).options(expand=&#8217;table&#8217;).value=[[1,2],[3,4]]<\/p>\n<p>\u00a0<\/p>\n<p>#xlwings API<\/p>\n<p>#sht.api.Range(&#8216;A5:B6&#8217;).Value=[[1,2],[3,4]]<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Write Python list data to Excel worksheet \n\nimport xlwings as xw    #Import the xlwings package\n\napp=xw.App()\nbk=app.books.active    #Get the active workbook\nsht=bk.sheets.active    #Get the active worksheet \n\n#Write rows\n#xlwings\n#lst=&#91;1,2,3,4,5]\n#sht.range('A1').value=lst    #Write Python data to Excel worksheet\n#Or\n#lst=&#91;1,2,3,4,5]\n#sht.range('E1').options(transpose=True).value=lst    #Transpose\n\n#xlwings API\n#lst=&#91;&#91;1],&#91;2],&#91;3],&#91;4],&#91;5]]\n#sht.api.Range('C1:C5').Value=lst    #Write directly\n#Or\n#lst=&#91;1,2,3,4,5]\n#sht.api.Range('E1:E5').Value=app.api.WorksheetFunction.Transpose(lst)    #Transpose\n\n#2D data\n#xlwings\nsht.range('A5:B6').value=&#91;&#91;1,2],&#91;3,4]]\nsht.range('A1').options(expand='table').value=&#91;&#91;1,2],&#91;3,4]]\n\n#xlwings API\n#sht.api.Range('A5:B6').Value=&#91;&#91;1,2],&#91;3,4]]\n\n#bk.close()\n#app.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/46.png\" alt=\"Write Python List Data to Excel Worksheet Using xlwings\" class=\"wp-image-339\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/46.png 883w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/46-300x164.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/46-768x419.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-xlwings-data"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":3,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":340,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/50\/revisions\/340"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}