Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming a picture in a macro 1

Status
Not open for further replies.

tcolan

Technical User
Apr 28, 2003
49
US
Hello,

Currently I am using a macro to grab an external bitmap file, resize it and paste it as a picture in excel. How do I set the picture to a specfic name in the macro? In other words, instead of pasting in picture and letting excel automatically name the picture "Picture 8", how would I name the picture my own reference, such as "Feb Results" in the macro?

Is there a way I can set the name of the picture I am pasting in the macro?

Thanks,
Tom

 
Hi,
Code:
    i = 1
....
    Set MyPic = ActiveSheet.Pictures.Insert(MyPixPathFile)
    With MyPic
      .Name = "My Pic " & i
      .Top = [B5}.Top
      .Left = [B5}.Left
    End with
    i = i + 1
and so forth. :)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top