Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 
share|improve this question
    
It works for me. What specific problem are you having? –  Doug Glancy Nov 18 '11 at 5:04
    
For me, it doesn't work at all! –  LongTTH Nov 20 '11 at 9:53
    
What does "doesn't work" mean in your case? Do the comments get created at all? –  masterjo Dec 14 '11 at 17:39
    
yes, when I hit Ctrl + Shift + R the comment was not gotten created at all. –  LongTTH Dec 15 '11 at 2:16
1  
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. –  masterjo Dec 15 '11 at 11:52
add comment

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.