Share via

How to bring comments/notes back into view?

York Lin 20 Reputation points
2025-07-13T19:35:17.1466667+00:00

All comments/notes in one of my Excel worksheets got pushed beyond visible range when the file was moved to a new computer. I can manually move it back into view and resize it back to its original look, but I can't do that for thousands of cells. It was suggested that setting up macros would fix it, but I've no idea how to do that.

Microsoft 365 and Office | Excel | For business | Windows

Answer accepted by question author

  1. Kai-Ex 1,225 Reputation points Microsoft External Staff Moderator
    2025-07-14T02:40:19.7266667+00:00

    Dear York Lin

    Thank you for posting your question in the Microsoft Q&A forum.

    I understand that technical issues can be frustrating, and I’d love to help you resolve this. Before giving you the best solution, could you please confirm these questions below to help me diagnose the issue more effectively: 

    • Are you using the same version of Excel on both the old and new computers?
    • Is it happened on the Excel Online? Have you tried on this?
    • Are these modern threaded comments or legacy notes (the kind that appear when you hover over a cell)?
    • Are the comments completely off-screen, or just misaligned/resized?
    • If possible, please kindly provide a screenshot to help us diagnose the issue more effectively.  ‌

    Based on your descriptions, here are some steps I recommend you try:

    Step 1: Open your Excel file.

    Step 2: Press Alt + F11 to open the VBA editor.

    Step 3: Choose View > Code

    image

    Step 4: 

    1. Put Comments/Note Back in Place

    Sub ResetComments()
    Dim cmt As Comment
    For Each cmt In ActiveSheet.Comments
       cmt.Shape.Top = cmt.Parent.Top + 5
       cmt.Shape.Left = _
     cmt.Parent.Offset(0, 1).Left + 5
    Next
    End Sub
    

    2. Get Comments/Note Back in Shape

    Sub Comments_AutoSize()
    'posted by Dana DeLouis  2000-09-16
    Dim MyComments As Comment
    Dim lArea As Long
    For Each MyComments In ActiveSheet.Comments
       With MyComments   
      .Shape.TextFrame.AutoSize = True
    If .Shape.Width > 300 Then
      lArea = .Shape.Width * .Shape.Height
      .Shape.Width = 200
      ' An adjustment factor of 1.1 seems to work ok.
      .Shape.Height = (lArea / 200) * 1.1
    End If
     End With
    Next ' comment
    End Sub
    
    
    

    image

    Step 5: Press F5 to run the macro.

    I hope this information is helpful. Please follow these steps and let me know if it works for you. If not, we can work together to resolve this.

    I'm looking forward for your reply.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.   


1 additional answer

Sort by: Most helpful
  1. Vivian-HT 15,530 Reputation points Microsoft External Staff Moderator
    2025-07-15T06:37:56.56+00:00

    Dear @York Lin,

    Thanks for your response! I truly appreciate your update and effort when go through the solution!

    Based on your description, here are detailed step by step to do it:

    Step 1: Open Your Excel File

    • Open the Excel workbook with the problematic notes on your new laptop.
    • Ensure you're on the worksheet with the off-screen notes.

    Step 2: Access the VBA Editor

    Press Alt + F11 on your keyboard. This opens the Visual Basic for Applications (VBA) Editor.

    • If this doesn't work, enable the Developer tab:
      • Go to File > Options > Customize Ribbon.
      • Check the box for Developer in the Main Tabs list, then click OK.
      • In the Developer tab, click Visual Basic.

    Step 3: Add the Macro

    • In the VBA Editor, look at the Project Explorer on the left (it lists your workbook, e.g., VBAProject (YourFileName.xlsx)).
    • Right-click on your workbook's name, then select Insert > Module. A new module (e.g., Module1) appears.
    • Double-click the new module to open a blank code window on the right.
    • Copy the following code and paste it into the blank code window:
    Sub ResetLegacyNotesPositionAndSize()
        Dim ws As Worksheet
        Dim cmt As Comment
        Dim cell As Range
        ' Set reference to active worksheet
        Set ws = ActiveSheet
        ' Loop through all cells with legacy notes in the worksheet
        For Each cell In ws.UsedRange
            If Not cell.NoteText = "" Then
                Set cmt = cell.Comment
                If Not cmt Is Nothing Then
                    ' Position note near its cell (top-left corner of cell)
                    cmt.Shape.Top = cell.Top
                    cmt.Shape.Left = cell.Left + cell.Width + 10
                    ' Set standard size for note (width, height in points)
                    cmt.Shape.Width = 200
                    cmt.Shape.Height = 120
                    ' Ensure note is hidden by default (shows on hover)
                    cmt.Visible = False
                End If
            End If
        Next cell
        MsgBox "All legacy notes have been repositioned and resized.", vbInformation
    End Sub
    
    1. Press F5 to save the code, then close the VBA Editor by clicking the red X or File > Close and User's image
    2. Return to Microsoft Excel.

    Step 4: Run the Macro

    1. In Excel, go to the Developer tab and click Macros (or press Alt + F8).
    2. In the Macro dialog box, select ResetLegacyNotesPositionAndSize from the list.
    3. Click Run. The macro will process all legacy notes in the active worksheet, moving them to the right of their cells and resizing them to 200x120 points.
    4. You’ll see a pop-up message saying, "All legacy notes have been repositioned and resized."

    Step 5: Save Your Workbook

    Save your workbook as a macro-enabled file to keep the macro:

    • Go to File > Save As.
    • Choose a location, then select Excel Macro-Enabled Workbook (*.xlsm) as the file type.
    • Click Save.

    Step 6: Verify the Fix

    • Hover over or click cells with notes (indicated by a red triangle in the top-right corner of the cell) to ensure the notes appear near the cell and are properly sized.

    Note: It is not automated applying to new notes, only current notes and comments are affected.

    I hope this information is helpful. Please follow these steps and let me know if it works for you. If not, we can work together to resolve this.

    I'm looking forward for your reply.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.   

    User's image

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.