Monday morning Macro Help

Found this bit of code donkey years ago:

Sub FindMeSizeMyHeight()   '        Just size the Height
    Dim SR As ShapeRange
    Dim s As Shape
    ActiveDocument.ReferencePoint = cdrCenter 'So your hole doesn't change position
    Set SR = ActiveSelection.Shapes.FindShapes()
    
    For Each s In SR
        s.SetSize 0, 2  ' Width , Height
    Next s
End Sub

I have a series of objects that I would like to change only the Height and keep their Widths
( and vice~versa for the Widths only & not height)

The above does both

Thanks for lookin!

Parents
No Data
Reply
  • I have a series of objects that I would like to change only the Height and keep their Widths
    ( and vice~versa for the Widths only & not height)

    My Adust Objects; Retain Positions macro can modify each of multiple selected obects, while keeping the desired position of each object.

    For the task you describe, one would use the "To Width" option on the "To Size" tab, have the "maintain aspect ratio" option unchecked, and click the "CX XY" button to apply it while keeping each object at its original center position.

    If you always wanted to perform exactly the same task, then of course a bespoke macro for that task will get you there with fewer clicks.

Children
No Data