changing a shape font to bold with VB

B

Brettjg

Hmmmm. There must be a trick to this one. The following code works just fine:

With ActiveSheet.Shapes("TB purchase n")
.Fill.Visible = msoTrue
End With

but this does not work:
With ActiveSheet.Shapes("TB purchase n")
.Font.Bold = True
End With

It seems when I'm working with a font I have to select the shape (which I'd
rather not do). This works:
ActiveSheet.Shapes.Range("TB purchase n").Select
Selection.Font.Bold = True

Could someonr throw some light on this for me please? Regards, Brett.
 
B

Bob Phillips

Try this

With ActiveSheet.Shapes("TB purchase n")
.TextFrame.Characters.Font.Bold = True
End With
 
B

Brettjg

Thanks Bob, that works, but this doesn't:

With ActiveSheet.Shapes.Range(Array("TB purchase 1", "TB purchase 2", "TB
purchase 3", "TB purchase"))
.TextFrame.Characters.Font.Bold = False
.Fill.Visible = msoFalse
End With

and I suspect that you can only use textframe with one shape. Is that right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top