excel 在注解中设置字体

b5lpy0ml  于 2023-11-20  发布在  其他
关注(0)|答案(1)|浏览(118)

我在单元格注解中添加了一些行,所以我需要字体“CockyNew”。但我还需要一些更具体的设置,如字体和大小。

  1. Sub SetCommants()
  2. With Cells(4, 8)
  3. If Not .Comment Is Nothing Then .Comment.Delete
  4. .AddComment
  5. .Comment.Visible = False
  6. .Comment.Text Cells(1, 3) & Chr(10) & Cells(1, 4) & Chr(10) & Cells(1, 5) & Chr(10) & Cells(1, 6)
  7. .Comment.Shape.TextFrame.AutoSize = True
  8. End With
  9. End Sub

字符串
我必须在代码中插入哪些行来设置字体?

lawou6xi

lawou6xi1#

  1. Sub SetCommants()
  2. Dim ar
  3. ar = Application.Transpose(Application.Transpose(Range("C1:F1")))
  4. With Cells(4, 8)
  5. If Not .Comment Is Nothing Then .Comment.Delete
  6. .AddComment
  7. .Comment.Visible = False
  8. .Comment.Text Join(ar, vbLf)
  9. With .Comment.Shape.TextFrame
  10. With .Characters(1).Font
  11. .Color = vbRed
  12. .Name = "Courier New"
  13. .Size = 16
  14. .Bold = True
  15. .Italic = True
  16. End With
  17. .AutoSize = True
  18. End With
  19. End With
  20. End Sub

字符串

展开查看全部

相关问题