adding hyperlinks in some cells openpyxl

后端 未结 4 1475
时光说笑
时光说笑 2021-01-04 01:09

I have to generate an excel with summary results. The results are included in a list. Some of the elements are values and some links.

I managed to generate the excel

4条回答
  •  执念已碎
    2021-01-04 01:18

    Try this :

    sheet['A1'].hyperlink = "http://stackoverflow.com"
    sheet['A1'].value="StackOverflow"
    

    In my try this does not add the formatting that Excel puts with a hyperlink but the cell contents are more like the Excel hyperlink cell than I get with the HYPERLINK tag.

提交回复
热议问题