autosize excel 2010 comment box when add a lot of text

2

0

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 

Luke

Posted 2011-11-17T14:07:22.783

Reputation: 1 044

It works for me. What specific problem are you having? – Doug Glancy – 2011-11-18T05:04:05.070

For me, it doesn't work at all! – Luke – 2011-11-20T09:53:25.010

What does "doesn't work" mean in your case? Do the comments get created at all? – joweiser – 2011-12-14T17:39:07.770

yes, when I hit Ctrl + Shift + R the comment was not gotten created at all. – Luke – 2011-12-15T02:16:48.037

2Just 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 – 2011-12-15T11:52:28.287

Answers

2

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

Raystafarian

Posted 2011-11-17T14:07:22.783

Reputation: 20 384