What I want to do is loop through all the shapes on a worksheet (for all worksheets in a workbook, I guess) and if they are textboxes, change some of the default formatting. I believe I have most of the code worked out, but am getting a runtime error that the object doesn't support being selected (object does not support this property or method) when I go to select it (the activesheet.shp.select line just a few down). Any suggestions? Code below:
Code:
For Each ws In ActiveWorkbook.Worksheets
ws.Select
For Each shp In ws.Shapes
If shp.Type = msoTextBox Then
ActiveSheet.shp.Select
With Selection
.HorizontalAlignment = xlJustify
.VerticalAlignment = xlCenter
.ShapeRange.TextFrame.MarginLeft = 7.09
.ShapeRange.TextFrame.MarginRight = 7.09
.ShapeRange.TextFrame.MarginTop = 3.69
.ShapeRange.TextFrame.MarginBottom = 3.69
.ShapeRange.Line.Weight = 0.25
.ShapeRange.Fill.Visible = msoTrue
.ShapeRange.Fill.Solid
.ShapeRange.Fill.ForeColor.SchemeColor = 65
.ShapeRange.Fill.Transparency = 0#
End With
End If
Next shp
Next ws