宏修改表格批注
Jump to navigation
Jump to search
同事用 WPS 做的表格批注,用 MS Office Excel 打开,批注框糊成一小块,看不全,用以下宏可解决。
1Sub ResizeAllComments()
2 Dim ws As Worksheet
3 Dim cmt As Comment
4
5 For Each ws In ThisWorkbook.Worksheets
6 For Each cmt In ws.Comments
7 With cmt.Shape
8 .Width = 200 ' 设置批注框宽度,可根据需要调整
9 .Height = 50 ' 设置批注框高度,可根据需要调整
10 End With
11 Next cmt
12 Next ws
13End Sub
代码来自通义千问,prompt:
用宏批量调整批注框的大小