excel 注释 默认大小_使用宏调整Excel注释的大小

excel 注释 默认大小

If you add comments to worksheet, eventually those comments might wander away from their original locations. Sometimes the comments change size too, and you need to adjust them. Instead of making changes manually, move or resize Excel comments with macros, to save time.

如果将注释添加到工作表中,最终这些注释可能会偏离其原始位置。 有时,注释也会更改大小,因此您需要对其进行调整。 不必手动进行更改,而是使用宏移动或调整Excel注释的大小,以节省时间。

Long ago, I shared macros to add comments, format or number them, change the author name, and other exciting things! You can see those comment macros on my Contextures site.

很久以前,我共享宏来添加注释,对其进行格式设置或编号,更改作者姓名以及其他令人振奋的事情! 您可以在我的Contextures网站上看到这些注释宏

For example, here is my code to change all the comments, on all sheet in the active workbook, to Times New Roman, 12 pt font.

例如,这是我的代码,用于将活动工作簿中所有工作表上的所有注释更改为12磅字体的Times New Roman。

Sub FormatAllComments()
'www.contextures.com/xlcomments03.html
  Dim ws As Worksheet
  Dim cmt As Comment
  For Each ws In ActiveWorkbook.Worksheets
    For Each cmt In ws.Comments
      With cmt.Shape.TextFrame.Characters.Font
        .Name = "Times New Roman"
        .Size = 12
      End With
    Next cmt
  Next ws
End Sub

新评论宏 (New Comment Macros)

Now there's a new page with comment macros, contributed by J. Woolley.

现在有一个新页面,其中包含由J. Woolley贡献的注释宏

There is a sample workbook to download, and it has 6 sheets with buttons to run the macros, and cells with comments for testing.

有一个示例工作簿可供下载,该工作簿有6页,其中包含用于运行宏的按钮,以及带有用于测试的注释的单元格。

评论宏 (Comment Macros)

The workbook contains 6 main comment macros, with a separate sheet for testing each macro. Here's the list, and quick note on what each macro does.

该工作簿包含6个主要的注释宏,以及用于测试每个宏的单独工作表。 这是列表,并简要说明了每个宏的功能。

  1. CommentAuthors - remove author name from start of comment

    CommentAuthors-从评论开始处删除作者姓名
  2. FormatComments - change comment font and size

    FormatComments-更改注释字体和大小
  3. ResizeComments - change comment size to fit its text

    ResizeComments-更改评论大小以适合其文本
  4. MoveComments - position each comment near its cell

    MoveComments-将每个评论放在其单元格附近
  5. CommentShadows - show or hide the comment's drop shadow

    CommentShadows-显示或隐藏评论的阴影
  6. UpdateComments - runs all of the macros listed above

    UpdateComments-运行上面列出的所有宏

选择宏选项 (Choose Macro Options)

Instead of having the options written into the macros, message boxes and input boxes let you control the macros before you run them.

不必将选项写入宏,而是通过消息框和输入框来控制宏,然后再运行它们。

First, each macro asks if you want to run the macro on the selected cells, or the entire worksheet.

首先,每个宏询问您是否要在选定的单元格或整个工作表上运行该宏。

NOTE: J. Woolley included a macro that changes the message box button text. This message has "Sheet", "Selection" and "Quit" buttons, instead of "Yes", "No" and "Cancel".

注意:J. Woolley包含一个宏,用于更改消息框按钮的文本。 该消息具有“表格”,“选择”和“退出”按钮,而不是“是”,“否”和“取消”按钮。

请确认 (Please Confirm)

Some macros have further confirmations, as you go along. For the CommentAuthors macro, you confirm for each author name, so you can skip the changes for some, and make changes for others.

继续操作时,某些宏还会有进一步的确认。 对于CommentAuthors宏,您需要确认每个作者的姓名,因此可以跳过某些更改,而对其他作者进行更改。

输入框 (Input Boxes)

In some macros, you can input the value(s) that you want to use, such as a font name or font size.

在某些宏中,您可以输入要使用的值,例如字体名称或字体大小。

使用宏调整Excel注释的大小 (Resize Excel Comments with Macros)

The most complex macro is the one to resize Excel comments. There are three "Resize Excel Comments" macros on my earlier page, using different methods to adjust the size. Some work better than others, but comment resizing is a tricky business!

最复杂的宏是调整Excel注释大小的宏。 在我的上一页中,有三个“调整Excel注释大小”宏,它们使用不同的方法来调整大小。 有些工具比其他工具效果更好,但是调整评论大小是一项棘手的事情!

I tested my "Resize by Cell Height" macro, to compare it with the results from J. Woolley's resize macro. In some cases, the results were almost identical. My macro sets a width though, so it didn't make comments narrow, where that was a good option. J. Woolley's macro prompts you to enter a maximum width, but uses a narrower width where possible.

我测试了“按单元格高度调整大小”宏,以将其与J. Woolley的调整大小宏的结果进行比较。 在某些情况下,结果几乎相同。 不过,我的宏设置了宽度,因此它不会使注释变窄,这是一个不错的选择。 J. Woolley的宏提示您输入最大宽度,但在可能的情况下使用较窄的宽度。

Here's an example of his narrower result (max of 200), compared to my comment that used the set width of 200. I like the narrower comment better – it just fits the longest line of text.

与使用设置宽度200的我的注释相比,这是他的结果较窄(最大200)的示例。我更喜欢较窄的注释-它适合最长的文本行。

获取样本工作簿 (Get the Sample Workbook)

To see J. Woolley's macros, go to the Excel Comment Macros page, and go to the Download section. Because of Microsoft security for downloaded files, you might need to unblock the zipped file.

要查看J. Woolley的宏,请转到“ Excel注释宏”页面 ,然后转到“下载”部分。 由于Microsoft对下载文件的安全性,您可能需要取消阻止压缩文件

The zipped file is in xlsm format, so be sure to enable macros when you open the workbook, if you want to test the macros.

压缩文件为xlsm格式,因此,如果要测试宏,请确保在打开工作簿时启用宏。

翻译自: https://contexturesblog.com/archives/2018/08/09/resize-excel-comments-with-macros/

excel 注释 默认大小

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值