Vba - Picture Object naming

J

Jeff

Hi,

I have a macro that copy's a range in the workbook to a picture.

1.) Copy's a range and saves as a picture

What I want to do - rename the picture object. I think it is named "Picture
1" or "Picture X" by default, but this is no good since I want to refer to it
later in the code.

Code:
Sub Create_picture()
'Create the picture
Worksheets("Pol Value").Range("A1:J50").CopyPicture xlScreen, xlBitmap

End sub

Thanks for your help
 
B

Bernie Deitrick

Jeff,

With Worksheets("Pol Value")
.Range("A1:J50").CopyPicture xlScreen, xlBitmap
.Paste Destination:=.Range("K1")
.Shapes(.Shapes.Count).Name = "NewPictureName"
End With

HTH,
Bernie
MS Excel MVP
 
M

Mike H

Jeff,

When you paste it it is selected so immedialtly after pasting try this

Selection.Name = "MyPicture"

Mike
 

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