Comment box disappears or moves

AndiH

New Member
Joined
Dec 3, 2009
Messages
41
I've inserted comments in many cells to use as an audit trail on my spreadsheet. Now when I open the spreadsheet, many of the comment boxes have closed up and moved far away from the original cell. All I can see is the call-out box line.

Is there a way to reformat all of them to restore and maintain the size of the comment box or do I have to do this one cell at a time? Argghh. Also, is there anything I can do to avoid this in the future?

I've seen threads which suggest changing "Tool Tips" in Windows but I can't find them in Windows 2003 and am uncertain this would be the solution anyway.
 

Colin Legg

MrExcel MVP, Like totally RAD man
Joined
Feb 28, 2008
Messages
3,497
Hi,

Save a back-up copy of your workbook (just in case).

Right click on the sheet tab and choose view code.

Paste in this code:
Code:
Sub FixComments()
    Const lngBUFFER As Long = 10
    
    Dim cmt As Comment
    
    For Each cmt In Comments
        cmt.Shape.Left = cmt.Parent.Left + cmt.Parent.Width + lngBUFFER
        cmt.Shape.Top = cmt.Parent.Top - lngBUFFER
        cmt.Shape.Placement = xlFreeFloating
    Next cmt
    
End Sub
Then left click anywhere inside the procedure so the cursor is flashing inside the procedure and press F5 to run it.
 

AndiH

New Member
Joined
Dec 3, 2009
Messages
41
Thank you Colin. I'm half-way there. It looks as if the comments have re-aligned to the appropriate cells but the comment text box itself is still closed.
A
 

Colin Legg

MrExcel MVP, Like totally RAD man
Joined
Feb 28, 2008
Messages
3,497
We can change the size of the comments within the procedure - I'm "working blind" here so my offering is:

Rich (BB code):
Sub FixComments()
    Const lngBUFFER As Long = 10
    
    Dim cmt As Comment
    
    For Each cmt In Comments
        cmt.Shape.TextFrame.AutoSize = True
        cmt.Shape.Left = cmt.Parent.Left + cmt.Parent.Width + lngBUFFER
        cmt.Shape.Top = cmt.Parent.Top - lngBUFFER
        cmt.Shape.Placement = xlFreeFloating
    Next cmt
    
End Sub
 

pecochran1

New Member
Joined
Mar 28, 2011
Messages
5
Colin, thank you this seems to have corrected the comment issues in my worksheet. THANK YOU!!!:)


We can change the size of the comments within the procedure - I'm "working blind" here so my offering is:

Rich (BB code):
Sub FixComments()
    Const lngBUFFER As Long = 10
    
    Dim cmt As Comment
    
    For Each cmt In Comments
        cmt.Shape.TextFrame.AutoSize = True
        cmt.Shape.Left = cmt.Parent.Left + cmt.Parent.Width + lngBUFFER
        cmt.Shape.Top = cmt.Parent.Top - lngBUFFER
        cmt.Shape.Placement = xlFreeFloating
    Next cmt
    
End Sub
 

Forum statistics

Threads
1,081,996
Messages
5,362,612
Members
400,684
Latest member
Vie

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top