+ Reply to Thread
Results 1 to 4 of 4

Use a Userform button to insert image in worksheet

  1. #1
    Registered User
    Join Date
    05-18-2011
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    24

    Use a Userform button to insert image in worksheet

    Hi Guys.

    I have a user form that contains a number of buttons, each showing a different picture. I want to click on one of these buttons, which will then close the userform and attach the image to the cursor so i can then click where I want to place the image in the worksheet.
    After clicking the location I want it to automatically open another userform that I will use to input data relevant to the picture.

    I currently have it that when I click on the button it places the image on the selected cell, but I only want to select the location after I click the button

    Any ideas?

    Barry
    Attached Files Attached Files
    Last edited by barrymac20; 06-20-2019 at 11:09 AM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Use a Userform button to insert image in worksheet

    Since you have full path to image file...

    May be set public variable to hold image path. Set it when button is clicked.

    Then use Worksheet_SelectionChange event, check if variable length > 0, if it is, insert image using variable, and using target position to adjust location.

    So something like...

    In standard module:
    Please Login or Register  to view this content.
    In Userform module:
    Please Login or Register  to view this content.
    In ThisWorkbook module.
    Please Login or Register  to view this content.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    05-18-2011
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Use a Userform button to insert image in worksheet

    Thanks for your help. Will give this a try.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: Use a Userform button to insert image in worksheet

    You might also hide the form, use Application.Inputbox(type:=8) to allow selecting a cell and then put the image there before finally unloading.
    Everyone who confuses correlation and causation ends up dead.

+ 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. Excel VBA: USERFORM simulate button click on image
    By ironfelix717 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-21-2022, 07:16 AM
  2. [SOLVED] Insert PNG image into userform
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 02-10-2021, 03:56 AM
  3. [SOLVED] VBA for Image Insert with Command Button
    By bod213 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-23-2018, 12:10 PM
  4. [SOLVED] Insert image by clicking button
    By brainzlp in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-03-2015, 05:19 AM
  5. [SOLVED] VBA to transfer image FROM userform image control TO a worksheet cell
    By Zoediak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 02:51 PM
  6. [SOLVED] Insert image on userform - .ico
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2014, 06:28 PM
  7. Insert an image button
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2012, 07:22 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