VBA & Macro Problems

How to Reposition Excel Comments Near Their Associated Cells

Algirdas JasaitisAlgirdas Jasaitis Nov 2, 2026 869 views

Question details

Users need a method to bring detached comments or notes back to their original associated cells in a large Excel worksheet.

How to Reposition Excel Comments Near Their Associated Cells
Product
Excel
Device & OS
not provided
Scenario
Navigating and managing large worksheets containing thousands of rows and comments.
Observed behavior
Comments and notes detach from their associated cells and move thousands of rows away, expanding the scroll range and making the worksheet difficult to read and navigate.
Before you start

Before running any VBA macro to reposition elements in your worksheet, ensure you save a backup copy of your file, as macro executions cannot typically be undone using the standard Undo button.

Solution 1Recommended

Use a VBA Macro to Reset Comment Positions

Running a VBA script is the most efficient and practical way to automate the repositioning of thousands of detached comments back to their parent cells.

When dealing with thousands of rows, manually dragging each comment back to its source cell is too time-consuming. A VBA macro can programmatically loop through every comment in your active worksheet and reset its spatial coordinates (Top and Left properties) to match its parent cell.

1
Open the VBA Editor

Press 'Alt + F11' on your keyboard to launch the Microsoft Visual Basic for Applications editor.

2
Insert a New Module

In the top menu, click 'Insert' and select 'Module' to create a blank script window.

3
Enter the Repositioning Code

Paste a standard comment-reset script (for example, a loop that sets 'cmt.Shape.Top = cmt.Parent.Top' and 'cmt.Shape.Left = cmt.Parent.Offset(0, 1).Left' for each comment).

4
Run the Macro

Press 'F5' or click the 'Run' button. The macro will execute and instantly snap all stray comments back next to their respective cells.

Use a VBA Macro to Reset Comment Positions
Save as Macro-Enabled: Remember to save your file as an Excel Macro-Enabled Workbook (.xlsm) if you want to keep the script available for future cleanups.
Advanced Macro Support

Fix and Manage Stray Comments Easily with WPS Spreadsheet

WPS Spreadsheet offers powerful built-in support for VBA and macros, allowing you to easily run scripts to reset floating comments. It effortlessly manages massive datasets with thousands of rows while maintaining perfect compatibility with your existing Excel workflows.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open the worksheet containing the detached comments.
  2. 2. Access the Developer Tools: Navigate to the 'Developer' tab on the ribbon and click on 'Macros', or simply press 'Alt + F11' to open the VBA Editor.
  3. 3. Insert and Run the Macro: Insert a new module, paste your comment-repositioning VBA script, and click Run to instantly restore all comments to their correct cell locations.
Fully compatible with Microsoft Excel (.xlsx and .xlsm) formats.Built-in robust VBA editor to seamlessly execute comment-resetting macros.Lightweight architecture ensures smooth scrolling and navigation even in massive worksheets.
microsoft office alternative - wps office

Frequently Asked Questions

Why do Excel comments move away from their original cells?

Comments can drift over time when rows or columns above and to the left of them are frequently inserted, deleted, hidden, or resized. In large files, this cumulative shifting causes the comment's shape to lose its original spatial relationship with the parent cell.

Can I lock comments so they don't move around in the future?

Yes. Right-click the cell containing the comment and select 'Edit Comment'. Then, right-click the border of the comment box, choose 'Format Comment', navigate to the 'Properties' tab, and select 'Move and size with cells'.

Is there a way to reset comment positions without using VBA?

Without VBA, you must manually drag each detached comment box back to its parent cell. Because this is highly impractical for worksheets with thousands of rows, using a VBA macro is the generally accepted and recommended solution.

Will running a repositioning macro delete the text inside my notes?

No. A repositioning macro only modifies the display coordinates (Top and Left properties) of the comment box. The actual text and data inside the comments remain completely unchanged.