+ Reply to Thread
Results 1 to 6 of 6

Copy image from UserForm to worksheet and center it + keep aspect ratio

  1. #1
    Registered User
    Join Date
    02-17-2020
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    28

    Copy image from UserForm to worksheet and center it + keep aspect ratio

    Hi there,

    follwing another thread in this forum, I used
    Please Login or Register  to view this content.
    to copy an image from a user form to a worksheet. The problem is that after restarting Excel, this image is then not loaded again but the message "The linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verify that the link points to the correct file and location." is displayed instead.
    A workaround by user Haluk uses
    Please Login or Register  to view this content.
    instead and supports loading after restarting Excel. Unfortunately, being a VBA newbie, I am not able to integrate it into my code which is scraped together from various websites. The main problem is to keep the image's aspect ratio and the centering in the target cell. It would be great if you could please help me adjust it. Here's the code:

    Please Login or Register  to view this content.
    Thank you very much in advance!
    Last edited by Menohavename; 02-20-2020 at 08:21 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Copy image from UserForm to worksheet and save worksheet

    Administrative Note:

    Hi and welcome
    although we value privacy as much as anyone else, it could be important that members have a rough idea of your location. You might in the future post questions which are bound to your regional settings.
    So, please update your profile to something more precise then "Here" ( country will suffice, no need to be more precise).
    Thank you for helping us to help you

  3. #3
    Registered User
    Join Date
    02-17-2020
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    28

    Re: Copy image from UserForm to worksheet and center it + keep aspect ratio

    Understood and changed.

  4. #4
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Copy image from UserForm to worksheet and center it + keep aspect ratio

    @Menohavename;

    Did you try the alternative code in the link below ? It was given as per your question in the thread...


    https://www.excelforum.com/excel-pro...ml#post5280441

    .

  5. #5
    Registered User
    Join Date
    02-17-2020
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    28

    Re: Copy image from UserForm to worksheet and center it + keep aspect ratio

    Yes, as mentioned above, it worked perfectly, thank you (I wanted to thank you in the old thread but was not able to for some reason). The only thing is that I'm wondering how to make the centering happen and how to keep the aspect ratio.

  6. #6
    Registered User
    Join Date
    02-17-2020
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    28

    Re: Copy image from UserForm to worksheet and center it + keep aspect ratio

    By the way, I figured it out now. Maybe this code helps others struggling with similar issues:

    Please Login or Register  to view this content.

+ 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. [SOLVED] Insert userform image into a worksheet
    By Axmed.cm in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-18-2020, 10:56 AM
  2. Get Image from worksheet to UserForm Image Control
    By sijostephen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2020, 06:54 AM
  3. transfaring an image from userform to worksheet
    By moedan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-12-2016, 09:26 AM
  4. [SOLVED] VGA to put userform into worksheet, and save sheet as a copy.
    By CtrlAltDelete in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-17-2014, 12:59 PM
  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] Looking for help copying an image from a userform to worksheet.
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2013, 09:34 AM
  7. [SOLVED] Macro to copy cells from one worksheet to another copies worksheet data as image instead??
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2012, 11:26 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