Consulting

Results 1 to 3 of 3

Thread: Solved: comments object, placement property

  1. #1
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location

    Solved: comments object, placement property

    To fix the "Cannot shift objects off sheet" problem I want to change all of a sheet's comments. I am weak with objects. I know I want to do
    .Comment.Shape.Placement = xlMoveAndSize
    but my problem is the object to apply this to and the For statement. Can you help?[vba]Sub Macro2()
    Dim obj As Object
    'Dim obj As Comment
    On Error Resume Next
    For Each obj In ActiveSheet.Shapes
    obj.Comment.Shape.Placement = xlMoveAndSize
    Next
    End Sub[/vba]
    I just found a cool semi-advanced VBA page - dictionary, queue, etc. http://analystcave.com/excel-vba-dic...ta-structures/

  2. #2
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location
    Greg Truby solved this for me elsewhere...[vba]Dim rngCell As Range

    On Error GoTo EndOfTheLine

    For Each rngCell In Cells.SpecialCells(xlCellTypeComments)
    rngCell.Comment.Shape.Placement = xlMoveAndSize
    Next rngCell
    EndOfTheLine:
    End Sub[/vba]
    I just found a cool semi-advanced VBA page - dictionary, queue, etc. http://analystcave.com/excel-vba-dic...ta-structures/

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi AG, glad you found a solution and thanks for posting it here for others.

    If you are posting the same question in other forums would you please post a link to them?

    Please read this.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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