简体   繁体   中英

Excel 2007 cell comments keep changing shape

I am working on a document in Excel 2007 which has a notable number of commented cells. But when I save the document for the day to continue the next day several of the comment fields take completely different shapes; the majority shrink down so that only a fraction of the text in them is visible or in some cases that the fields become a lot bigger. Is there any way to fix this?

This little macro should at least fix all the comments in one go:

Sub CommentFixer()
    Dim c As Comment
    For Each c In ActiveSheet.Comments
        c.Shape.TextFrame.AutoSize = True
    Next
End Sub

EDIT#1:

Macros are very easy to install and use:

  1. ALT-F11 brings up the VBE window
  2. ALT-I ALT-M opens a fresh module
  3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it. If you are using a version of Excel later then 2003, you must save the file as .xlsm rather than .xlsx

To remove the macro:

  1. bring up the VBE window as above
  2. clear the code out
  3. close the VBE window

To use the macro from Excel:

  1. ALT-F8
  2. Select the macro
  3. Touch RUN

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

and

http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx

Macros must be enabled for this to work!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM