+ Reply to Thread
Results 1 to 7 of 7

vba: Inserting Image or Picture

  1. #1
    Registered User
    Join Date
    06-12-2014
    Location
    Makati Philippines
    MS-Off Ver
    MS OFFICE 2010
    Posts
    58

    vba: Inserting Image or Picture

    Hi All,

    If i have different images/pictures in each sheets. What is the best code to use to call or insert that image that was in the sheet that my code called and insert or paste it into the userform?

    for example

    in sheet1 i have an image of a tree
    in sheet2 i have an image of a boy

    my code called sheet2 and in the userform it should paste the image of the boy
    and if my code calls sheet1 it should paste the image of the tree.
    Last edited by saikong051; 08-19-2014 at 06:28 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: vba: Inserting Image or Picture

    see my testfile attached
    if problems attach please a samplefile with some images and the userform
    Attached Files Attached Files
    Last edited by patel45; 08-18-2014 at 12:43 PM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    06-12-2014
    Location
    Makati Philippines
    MS-Off Ver
    MS OFFICE 2010
    Posts
    58

    Re: vba: Inserting Image or Picture

    Hi Patel,

    I've attached a sample file for this.

    if i choose Team2. it should paste the team2 picture.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: vba: Inserting Image or Picture

    see attached
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-12-2014
    Location
    Makati Philippines
    MS-Off Ver
    MS OFFICE 2010
    Posts
    58

    Re: vba: Inserting Image or Picture

    Thank you so much patel45. Rep added.

  6. #6
    Registered User
    Join Date
    06-12-2014
    Location
    Makati Philippines
    MS-Off Ver
    MS OFFICE 2010
    Posts
    58

    Re: vba: Inserting Image or Picture

    Hi Patel,

    Im getting an error "Subscript out of range" when i apply the code to my project.

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: vba: Inserting Image or Picture

    did you rename all images with sheet name ? have a look on my example, each image has the same name as the sheet
    Last edited by patel45; 08-19-2014 at 12:30 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy an Image from a User form Picture Box to Worksheet Picture Box
    By sledgehammer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2014, 11:39 AM
  2. Inserting Picture into Comment and re-sizing to fit chosen picture
    By ericmartin.hr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2014, 01:53 AM
  3. [SOLVED] Auto-Inserting Picture or Image
    By harishs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2013, 11:12 AM
  4. image & picture
    By Tom Rudski in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2005, 03:35 PM
  5. get a picture width and height without inserting the picture
    By Dorothy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2005, 02:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1