+ Reply to Thread
Results 1 to 2 of 2

Stupid Comments moving around

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-13-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    279

    Stupid Comments moving around

    I do not know what causes it but comments linked to a cell always seem to fly off many rows and columns away.

    Also the size of the comment changes.

    This must be a known issue in Microsoft 2010 and is frankly ridiculous.

    If anyone has any ideas on how to prevent this please do tell me.

    Maybe a macro?

    Thanks very much!

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Stupid Comments moving around

    Give this a try....
    Sub CommentFix()
    
     ' This macro modifies all comments in all open workbooks to:
     ' (1) move and size with cells
     ' (2) be physically positioned near the cell to which they correspond
     ' (3) be optimally sized appropriate to the text within
     ' This macro was created by combining code posted on the following website:
     ' http://www.contextures.com/xlcomments03.html
    
     Dim thisfile As Workbook
     Set thisfile = ActiveWorkbook
     Dim MyWorkbook As Workbook
     Dim MySheet As Worksheet
     Dim MyComment As Comment
     Dim CommentCount As Long
     Dim lArea As Long
     Dim fixed As Boolean
     fixed = False
     On Error GoTo NeedToUnprotect
     For Each MyWorkbook In Workbooks
     MyWorkbook.Activate
     For Each MySheet In MyWorkbook.Sheets
     MySheet.Activate
     CommentCount = 0
     For Each MyComment In MySheet.Comments
     With MyComment.Shape
     .Placement = xlMoveAndSize
     .Top = MyComment.Parent.Top + 5
     .Left = MyComment.Parent.Offset(0, 1).Left + 5
     .TextFrame.Characters.Font.Name = "Tahoma"
     .TextFrame.Characters.Font.Size = 8
     .TextFrame.AutoSize = True
     CommentCount = CommentCount + 1
     End With
     If MyComment.Shape.Width > 300 Then
     lArea = MyComment.Shape.Width * MyComment.Shape.Height
     MyComment.Shape.Width = 200
     MyComment.Shape.Height = (lArea / 200) * 1.1
     End If
     Next MyComment
     If CommentCount > 0 Then
     MsgBox ("A total of " & CommentCount & " comments in worksheet '" & MySheet.Name & "' of workbook '" & MyWorkbook.Name & "'" & Chr(13) & "were repositioned and resized.")
     fixed = True
     End If
     Next MySheet
     Next MyWorkbook
     thisfile.Activate
     If fixed = False Then
     MsgBox ("No comments were detected.")
     End If
     On Error GoTo 0
     Exit Sub
    
     NeedToUnprotect:
     MsgBox ("You must unprotect all worksheets before running the macro.")
     thisfile.Activate
     Exit Sub
    
     End Sub
    Hope this helps, or at least gets you on the right track.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Moving Cell Comments to a Search Box
    By tony75 in forum Excel General
    Replies: 4
    Last Post: 10-27-2014, 03:30 PM
  2. [SOLVED] Moving cell contents as comments-to be part of big routine
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2014, 10:50 PM
  3. How to prevent comments from moving when rows grouped?
    By droppingtodos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2008, 04:32 PM
  4. How to prevent comments from moving when rows grouped?
    By bristly in forum Excel General
    Replies: 1
    Last Post: 07-30-2008, 10:59 AM
  5. comments moving randonmly after a save & close
    By Tam in forum Excel General
    Replies: 2
    Last Post: 03-31-2006, 01:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1