+ Reply to Thread
Results 1 to 15 of 15

Comment Box Availability and Sizing

  1. #1
    Registered User
    Join Date
    10-17-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2016
    Posts
    99

    Comment Box Availability and Sizing

    Hello,

    I am working my way through 2 issues. Both have to do with comments and are found in the range "L4:L9,L11:L16,L18:L44"

    1) Before protecting the sheet, I select "edit objects" so that I can insert comments. However, when I run my "New Period" Macro I lose the ability to insert comments when the sheet re-protects itself at the end. Is there a way to have the "edit objects" option always selected when it re-protects?

    2) Is there a way to auto-size the comment box based on the text that is entered?

    Adam
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Comment Box Availability and Sizing

    Does this help?
    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    10-17-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Comment Box Availability and Sizing

    I receive an error message of Invalid call procedure or argument when it gets to .AddComment

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Comment Box Availability and Sizing

    Did you replace the "?" with the actual cell address? Post the code.

  5. #5
    Registered User
    Join Date
    10-17-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Comment Box Availability and Sizing

    With Range("L4:L9,L11:L16,L18:L44")
    .AddComment
    .Comment.LockAspectRatio = msoTrue
    .Comment.Visible = False
    .Comment.Shape.LockAspectRatio = msoTrue
    .Comment.Shape.DrawingObject.AutoSize = True
    End With

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Comment Box Availability and Sizing

    Sorry, I copied too many lines.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-17-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Comment Box Availability and Sizing

    With Range("L4:L9,L11:L16,L18:L44")
    .AddComment
    .Comment.Visible = False
    .Comment.Shape.LockAspectRatio = msoTrue
    .Comment.Shape.DrawingObject.AutoSize = True
    End With


    It still stops at .AddComment

    Message reads:

    Run time error '5':
    Invalid procedure call or argument

  8. #8
    Registered User
    Join Date
    12-16-2014
    Location
    gurgaon
    MS-Off Ver
    2007
    Posts
    1

    Re: Comment Box Availability and Sizing

    data value
    vijay
    vijay
    vijay 43
    vijay
    kama
    kama
    kama 57
    kama
    ram
    ram
    ram 70
    ram 94
    nam 75
    nam

    This the data of my excel sheet where i need to remove duplicate value in other sheet and want vlookup with value i want to remove blank cell

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Comment Box Availability and Sizing

    @vijaybhatt14,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    * Don't reply in this thread - start your own.
    Last edited by protonLeah; 12-17-2014 at 12:13 AM.

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Comment Box Availability and Sizing

    You have to do one cell at a time, not a whole range at once.

    Please Login or Register  to view this content.
    runs w/o errors.
    Last edited by protonLeah; 12-17-2014 at 03:50 PM.

  11. #11
    Registered User
    Join Date
    10-17-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Comment Box Availability and Sizing

    The Macro runs without error, but now i am unable to insert comments, perhaps i am placing the code in the wrong part of the module.

  12. #12
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Comment Box Availability and Sizing

    Can you post a sample wb (with code). When I run the code on a blank sheet, I can insert comments anywhere and edit those in column L.

  13. #13
    Registered User
    Join Date
    10-17-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Comment Box Availability and Sizing

    Attached is my current workbook. Thanks again for the help. I appreciate it.
    Attached Files Attached Files

  14. #14
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Comment Box Availability and Sizing

    You have a line:
    ActiveSheet.Protect Password:= "COGS",
    Try:
    ActiveSheet.Protect Password:= "COGS", DrawingObjects:=False

  15. #15
    Registered User
    Join Date
    10-17-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Comment Box Availability and Sizing

    Thanks, works great.

    Adam

+ 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. Inserting Picture into Comment and re-sizing to fit chosen picture
    By ericmartin.hr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2014, 01:53 AM
  2. Copy contents of multiple comment boxes and paste in a single comment box
    By xxJaRxx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-14-2014, 12:39 PM
  3. Disable Delete Comment, Edit Comment, Show/Hide Comment
    By Shanthan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2013, 06:12 AM
  4. [SOLVED] VBA Availability?
    By Paul Fenton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2006, 09:50 AM
  5. [SOLVED] Comment Box Auto-sizing
    By Bill Davis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-13-2005, 05:06 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