pythonwl
df.loc[1, \'地址(断网)\'] = \'=HYPERLINK("#Sheet2!B2","单元格的名字")\' # 超链接写入单元格

问题:打开excel单元格是文本,需要点击公式框,然后才可以变成连接,

解决:用xlwt模块,无问题

        import xlwt
        book = xlwt.Workbook()
        sheet_index = book.add_sheet(\'index\')
        line = 0
        for i in range(9):
            sheet1 = book.add_sheet(str(i))
            sheet1.write(0, 0, str(i))
            link = \'HYPERLINK("#%s!B2";"%s")\' % (str(i), str(i))
            sheet_index.write(line, 0, xlwt.Formula(link))
            line += 1
        book.save(\'simple2.xls\')

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-09-27
  • 2022-02-11
  • 2021-04-25
猜你喜欢
  • 2021-12-14
  • 2021-07-08
  • 2021-09-06
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案