PDA

View Full Version : Quick way to apply size and position to Object?



Vaslo
08-28-2012, 08:58 AM
Hello everyone,

Maybe there is a quick way to do this with PowerPoint functions, but I assume VBA is necessary. I am cutting and pasting a chunk of spreadsheet to a slide as Microsoft Object. For each of these, I have to manually apply a new size and position to ensure it fits on each slide correctly in the area provided. Is there a way to do this with PowerPoint already, or has anyone seen a piece of code to do this?

Thanks!

John Wilson
08-29-2012, 01:01 AM
Straight after the Paste (while still selected)

Sub Move_Size()
With ActiveWindow.Selection.ShapeRange(1)
.LockAspectRatio = True
.Top = in2Points(1) '1 inch from top
.Left = in2Points(1) '1 inch from left
.Width = in2Points(4) '4 inches wide
End With
End Sub

Function in2Points(inVal As Single)
in2Points = inVal * 72
End Function