Macro for multiple worksheets
Any help would be appreciated. I have a workbook with several
spreadsheets that contain small picture files. Each time I open the
workbook I would like a macro to run on each worksheet and resize the
files to a specific size. The code I have so far is below. It only
resizes the images on the worksheet that is active when opening the
document. What am I missing?
Thanks!
---------------------------------------------
Sub Auto_Open()
Dim ws As Worksheet
For Each ws In Worksheets
ActiveSheet.DrawingObjects.Select
With Selection
.ShapeRange.LockAspectRatio = msoTrue
.ShapeRange.Height = 21#
.ShapeRange.Width = 24.75
.ShapeRange.Rotation = 0#
.Placement = xlMove
.PrintObject = True
End With
Next ws
End Sub
|