View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Brettjg Brettjg is offline
external usenet poster
 
Posts: 295
Default Bold font in shapes

Thanks very much Rick, I think that will do it. I always forget about using
the very useful "For". Regards, Brett

"Rick Rothstein" wrote:

Give this code a try (expand the array as far as needed)...

Dim S As Shape
For Each S In ActiveSheet.Shapes.Range(Array( _
"Text Box 26900", "Text Box 26901"))
S.TextFrame.Characters.Font.Bold = True
S.Fill.Visible = msoTrue
S.Fill.ForeColor.SchemeColor = 52
Next

--
Rick (MVP - Excel)


"Brettjg" wrote in message
...
I've been trying to work around this but don't seem to be getting
anywhere. I
would much prefer not to have to select the shape array in order to make
the
font bold, but the only way seems to be to do them individually with
.textframe (and because there might be 15 shapes in the
array........forget
it)

This works for BOTH shapes:
ActiveSheet.Shapes.Range(Array("Text Box 26900", "Text Box 26901")).Select
With Selection
.Font.FontStyle = "Bold"
.ShapeRange.Fill.Visible = msoTrue
.ShapeRange.Fill.ForeColor.SchemeColor = 52
End With

and this works for ONLY ONE shape (because of .textframe)
With ActiveSheet.Shapes("Text Box 26900")
.TextFrame.Characters.Font.Bold = True
.Fill.Visible = msoTrue
.Fill.ForeColor.SchemeColor = 52
End With

Does anyone have a solution, or am I stuffed? Regards, Brett.