How do I name a picture as I paste it from VBA? (ActiveSheet.Past.

L

Leitey

I want to use VBA (and maybe some variation of the ActiveSheet.Paste
command?) to paste the image on the clipboard into Excel under a certain name
i.e. "samplepicture". I have tried "ActiveSheet.Paste.samplepicture" and
"ActiveSheet.Shapes("samplepicture").Paste" but can't seem to find a good
syntax.
 
E

Earl Kiosterud

Leitey,

When you paste, it'll be selected.

ActiveSheet.Paste
Selection.Name = "samplepicture"
 
D

Dave Peterson

One more way...

After you've pasted the picture, it's the picture with the highest index.

dim myPict as picture
with activesheet
.paste
set mypict = .pictures(.pictures.count)
end with
mypict.name = "SamplePicture"
 
Top