Text paragraphs and image

M

Mika

Hello,

I have an Excel 97 sheet which has an image.

How can I use VBA to write text over the image? I guess I have to add a
text box first but don't know how to do it.

Can I do that? Is it possible to write several paragraphs and indent the
first one?

Thanks,
Mika
 
R

Robin Hammond

This is an adjustment of something that I did with the macro recorder. I
don't think that the text boxes allow for indented paragraphs, but you can
have line breaks.

Sub Macro1()

Range("a1").Select
ActiveSheet.Pictures.Insert("C:\A picture.jpg").Select
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 224.25, 118.5, _
201#, 108.75).Select
With Selection
.Characters.Text = "Text" & Chr(10) & "whatever"
.ShapeRange.Fill.Visible = msoFalse
.ShapeRange.Line.Visible = msoFalse
End With

End Sub

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in
 

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