from openpyxl import load_workbook
from openpyxl.comments import Comment

wb = load_workbook(filename='123.xlsx',read_only=False)
sheet = wb['Sheet1']

for row in sheet['A4':'AC25']:  #选择修改范围
    for cell in row:
        if cell.value:
            comment = Comment(cell.value,'yara')
            comment.width = 200
            comment.height = 40
            cell.comment = comment

wb.save('comment.xlsx')

 

相关文章:

  • 2021-12-23
  • 2021-08-16
  • 2021-12-11
  • 2022-01-16
  • 2021-06-04
  • 2021-11-29
  • 2021-12-26
  • 2021-07-28
猜你喜欢
  • 2021-07-27
  • 2021-12-25
  • 2021-11-29
  • 2021-12-29
  • 2021-04-19
  • 2022-01-02
相关资源
相似解决方案