+ Reply to Thread
Results 1 to 9 of 9

VBA code to inserti image into cell not working

  1. #1
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    VBA code to inserti image into cell not working

    Hi Everyone

    This is the first time I am posting to this forum; I am a bit lost with a VBA code that I found on a youtube guide video.

    I am trying to have this code display a picture in a spreadsheet based on the cell text. I have a car's list, and for each of them, I want to display the logo instead of the name, but when I run the code, it clear the cell instead of showing the picture. I have the logos in a folder on my computer in PNG format as in the video.

    I will attach the excel file with the cars list and the code for you to understand better and also, I have a GIF file where I replicate the issue (i wasn't able to upload this one same as the document)

    Thanks a lot in advance to all who decide to help me and to this great forum
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA code to inserti image into cell not working

    Hi, welcome to the forum.
    Your file contains links to a file which is not accessible for us. (DRI 1985-H21.xlsx
    There is no code in this file. (And no code in the oinked file)
    Please attach a file with valid links and the code you're using
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Re: VBA code to inserti image into cell not working

    Hi, Keebellah. Thank you so much for taking the time on looking into this.

    I will now attach the Macro-Enabled file with all pages in it so that you should be able to see the code, and no links will be required.
    I hope this enables you to get to the code.
    Attached Files Attached Files

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA code to inserti image into cell not working

    Where do you want to paste the car's logo's?
    In CAR CHECK or in each of the other sheets?

  5. #5
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Re: VBA code to inserti image into cell not working

    I would like the car logo to go in the CAR CHECK sheet so that each cell containing the car name will be changed with the logo

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA code to inserti image into cell not working

    Okay, I'll see what I can do for you

  7. #7
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,457

    Re: VBA code to inserti image into cell not working

    there is a delay problem with copying shapes into your worksheet.
    There is now a delay of around 250 milliseconds in copying & pasting, and sometimes it still produces errors.

    So a first trial.
    Attached Files Attached Files
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA code to inserti image into cell not working

    Tip, save the images as named shapes in the file and just copy the one you need
    Am still working on the sample here, will update when completed

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA code to inserti image into cell not working

    This is the way I would do it.
    I also corrected your formulas to get rid of the N/A that's very messy and sloppy

    There is an extra worksheet named Foglio_Admin where there is a car brand table and a textbox explaining it.
    Foglio1 and CAR CHECK have a button Update to udate the car logo's

    If you stick to the rules it will work.
    Attached Files Attached Files

+ 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. VBA code for reference cell for image
    By chintamani.avinash in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2020, 04:18 AM
  2. vba - Export cell range to image on desktop! Help with code
    By ironfelix717 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2017, 06:33 AM
  3. Search box code - Will display an image and clear to remove image
    By mutzie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-06-2016, 11:10 AM
  4. Paste as image code not working on newer Excel versions
    By RenanCip in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2014, 12:26 PM
  5. Image to appear in one cell from a working formula in another
    By M-Tommo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-14-2013, 09:00 AM
  6. [SOLVED] Code to copy data in cell, but not image over cell.
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 7
    Last Post: 10-02-2013, 12:52 AM
  7. Code in ActiveX Image Box is not working
    By mgalterio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2012, 12:58 PM

Tags for this Thread

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