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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Leitey,

When you paste, it'll be selected.

ActiveSheet.Paste
Selection.Name = "samplepicture"
 
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"
 

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

Back
Top