Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Comment Box size (Office 2000)

    How do I write a macro to automatically size comment boxes. I can do this in the spreadsheet by editting, selecting, and formating the comment box by clicking on autosize in the alignament tab. But how do I write a macro to do this?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Comment Box size (Office 2000)

    Comments are included in the sheets Shapes collection, and assuming that you do not change the default name for each comment and that you have not given a name starting with Comment to any other shape(s), then the following apperoach should work. This AutoSizes all comments in the active sheet.

    Dim i as Integer
    For i = 1 To ActiveSheet.Shapes.Count
    If Left(ActiveSheet.Shapes(i).Name, 7) = "Comment" Then
    ActiveSheet.Shapes(i).TextFrame.AutoSize = True
    End If
    Next


    Andrew C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •