2

I'm finding some way to make Excel comment box auto-size when I add a lot of text into it.
Some tries with Google and I've got this from Ozgrid but it doesn't work on my Excel 2010. Please help me some idea to make it work! Thanks!

Sub robot_comment() 

    ' robot_comment Macro 
    ' Keyboard Shortcut: Ctrl+Shift+R 

    Dim objComment As Comment 

    Set objComment = ActiveCell.AddComment 
    With objComment 
        .Visible = False 
        .Text Text:="robot" 
        .Shape.TextFrame.AutoSize = True 
    End With 
End Sub 
5
  • It works for me. What specific problem are you having? Nov 18, 2011 at 5:04
  • For me, it doesn't work at all!
    – Luke
    Nov 20, 2011 at 9:53
  • What does "doesn't work" mean in your case? Do the comments get created at all?
    – joweiser
    Dec 14, 2011 at 17:39
  • yes, when I hit Ctrl + Shift + R the comment was not gotten created at all.
    – Luke
    Dec 15, 2011 at 2:16
  • 2
    Just to check: you did specify the keyboard shortcut Ctrl+Shift+R to call this macro? Because it's not sufficient to paste this code in the editor - the shortcut needs to be set in another menu.
    – joweiser
    Dec 15, 2011 at 11:52

1 Answer 1

2

Keyboard shortcuts must be defined in the macro creation screen, not in the macro comments.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .