+ Reply to Thread
Results 1 to 5 of 5

Resize Comments Box

  1. #1
    John
    Guest

    Resize Comments Box

    Can anyone explain preferably with an example how you set the size or
    re-size a cells comments box using vba code.

    Regards

    John



  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning John

    Sub Macro1()
    ' This will resize to your specification.
    Range("A1").Comment.Shape.Select True
    Selection.ShapeRange.ScaleWidth 1.5, msoFalse, msoScaleFromTopLeft
    Selection.ShapeRange.ScaleHeight 2.5, msoFalse, msoScaleFromTopLeft
    End Sub

    Sub macro2()
    ' This will autosize the comment box
    Range("A1").Comment.Shape.TextFrame.AutoSize = True
    End Sub

    Two example of how to resize a comment box, attached to cell A1.

    HTH

    DominicB

  3. #3
    Norman Jones
    Guest

    Re: Resize Comments Box

    Hi John,

    See Debra Dalgleish's page on resizing comments at:

    http://www.contextures.com/xlcomments03.html#Resize


    ---
    Regards,
    Norman



    "John" <[email protected]> wrote in message
    news:[email protected]...
    > Can anyone explain preferably with an example how you set the size or
    > re-size a cells comments box using vba code.
    >
    > Regards
    >
    > John
    >




  4. #4
    John
    Guest

    Re: Resize Comments Box

    Thanks Norman

    "Norman Jones" <[email protected]> wrote in message
    news:Ol%[email protected]...
    > Hi John,
    >
    > See Debra Dalgleish's page on resizing comments at:
    >
    > http://www.contextures.com/xlcomments03.html#Resize
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "John" <[email protected]> wrote in message
    > news:[email protected]...
    >> Can anyone explain preferably with an example how you set the size or
    >> re-size a cells comments box using vba code.
    >>
    >> Regards
    >>
    >> John
    >>

    >
    >




  5. #5
    Ken Johnson
    Guest

    Re: Resize Comments Box

    Hi John,
    If you Want to Make the comment TextFrame a particular height and
    width you could use something like the following which resizes the
    comment in A1 of the activesheet to a height of 50 points and a width
    of 100 points:


    On Error Resume Next 'Stop error when no comment
    With ActiveSheet.Range("A1").Comment.Shape
    .Width =3D 100
    .Height =3D 50
    End With
    On Error GoTo 0

    Alternatively, if you just want the comment textframe to automatically
    accommodate a different size comment you could just use:

    On Error Resume Next 'Stop error when no comment
    Activesheet.Range("A1").Comment.Shape.TextFrame.AutoS=ADize =3D True
    On Error Goto 0

    Hope this is useful
    Ken Johnson


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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