+ Reply to Thread
Results 1 to 11 of 11

Insert a picture from an UserForm

  1. #1
    Registered User
    Join Date
    08-03-2008
    Location
    Asturias (Spain)
    Posts
    4

    Insert a picture from an UserForm

    Sorry for my bad English.
    I'm making a UserForm for a coin collection. In this UserForm I want to look for a picture, show it in the userform and then insert it into a cell of my sheet.
    ¿Can someone help me? Thanks
    Last edited by VBA Noob; 08-03-2008 at 04:03 AM.

  2. #2
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Hi Rachelies.

    "In this UserForm I want to look for a picture..."

    What is the source of your pictures? Are they already loaded in the userform? Will you need to browse your hard drive for a picture, load and view it in your userform, and then send it to a range?

    What have you developed to this point?

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475
    Check out this example on inserting pics
    Select the blue cell and pick a picture.

    The example is located from this thread
    Last edited by davesexcel; 08-03-2008 at 07:44 AM.

  4. #4
    Registered User
    Join Date
    08-03-2008
    Location
    Asturias (Spain)
    Posts
    4
    Quote Originally Posted by Tom Schreiner
    Hi Rachelies.

    "In this UserForm I want to look for a picture..."

    What is the source of your pictures? Are they already loaded in the userform? Will you need to browse your hard drive for a picture, load and view it in your userform, and then send it to a range?

    What have you developed to this point?
    I want to do exactly this!!!! Can someone help me to do this? Thanks

  5. #5
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Hi Rachelies.

    "I'm making a UserForm for a coin collection."

    Help you or do it for you? Do you have anything to post? Have you made any attempt on your own? Please post your code or at least an attachment...

  6. #6
    Registered User
    Join Date
    08-03-2008
    Location
    Asturias (Spain)
    Posts
    4
    I know how to make the buttons, save the data into the sheet, but i dont know how to make the picture, so I answer. And I will not begin to make the userform if I don´t know how to make the picure,
    I only know a few of excel, but I know much about other materies, and if I could, I would help.

  7. #7
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Ok. Add UserForm1 with two commandbuttons named BrowseForFile and SendPictureToRange and Image1. The picture is inserted into the same dimenions as the selected range.

    Add the following code...

    Please Login or Register  to view this content.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Tom,

    I am not sure why you are using API calls here. The UserForm has both a Show and Hide method.

    Sincerely,
    Leith Ross

  9. #9
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Hi Leith.

    If the userform is modeless then using the hide and show methods would be fine.

    As it is, you would have to use Me.Show vbModeless or the remainder of the SendPictureToRange_Click procedure would not run. Of course you could throw some instructions in an event procedure but the several API functions are more concise IMO.

    The API method will work with a modeless of modal userform.

    Is there an easier way to do this that I am missing...?

    Thanks -

  10. #10
    Registered User
    Join Date
    12-07-2013
    Location
    Application.visible=false
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Insert a picture from an UserForm

    all this to store a string ? can use public variables in a module, or a hidden cell/sheet...

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Insert a picture from an UserForm

    Quote Originally Posted by saiya View Post
    all this to store a string ? can use public variables in a module, or a hidden cell/sheet...
    Funny how you only comment on very old threads, like this one, it is 5-1/2 years old.
    All your other posts are just comments on very old threads.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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