+ Reply to Thread
Results 1 to 1 of 1

Function Image : Problem with the code VBA

  1. #1
    Registered User
    Join Date
    08-26-2015
    Location
    Montreal
    MS-Off Ver
    2013
    Posts
    1

    Function Image : Problem with the code VBA

    Hi,
    I'm not an expert with VBA and i copied a code from this forum but there is an error in it and i can't figure out how to fix it, i hope someone will see this and help me with it.
    I have multiples sheets with this function in multiples cells :

    =SI(D22="LUNETTES",Image("lunettes.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="BOTTES - SOULIERS",Image("bottes.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(OU(D22="GANTS",D22="GANTS TIG",D22="GANTS NSK24"),Image("gants.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="SARRAU",Image("sarrau.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="BOUCHONS",Image("bouchons.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="CASQUE",Image("casque.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="DOSSARD",Image("dossard.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="HABIT PEINTRE",Image("habitpeintre.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="HARNAIS",Image("harnais.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(OU(D22="MASQUE ANTI POUSSIERE",D22="MASQUE CARTOUCHES"),Image("masque.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="MASQUE VENTILLE",Image("masqueventil.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),SI(D22="VISIERE COMPLETE",Image("visiere.png","K:\Public\TDC\02 - SANTE SECURITE\Équipements de sécurité\Images"),""))))))))))))

    ** SI = IF , sorry my excel is in french but my code is in english

    So i have this function Image(....) where i put the name of my picture that i want to insert and the path to go get it on my computer and there is multiple IF because depending on the value of the cell right under it I want the image to change. The function take the cells that has the formula above in it and put a picture of the same size of that cell in it. The mecanic is quite simple but the programming is way more complicated for me.

    So in my Module1 I have this code that i copied from an other thread.
    Please Login or Register  to view this content.
    The problem is that when ever i open the file or when i insert an other row in an sheets that doesn't even have any cells with the function in it, i got all the picture from the previous page appearing on the middle on my page (usually the same cells of the page with the function in it in the previous sheets)

    I can't work in this files without always having to delete some picture that appears when ever in insert a new row or delete one....

    I'm sure there is something wrong with the programming but i don't have the skills to figure it out. This is my first post on the site but i'm not new, i have used a lot of other post to do my work and to fix some other bugs, but i can't find anything about my problem.

    When i debug the code, i can see that :
    Please Login or Register  to view this content.
    Can anyone help me?
    Last edited by Leith Ross; 08-26-2015 at 05:28 PM. Reason: Added Code Tags

+ 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. Problem with image File Link in Cell not opening image for preview
    By Orada in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2015, 09:33 AM
  2. Replies: 6
    Last Post: 03-09-2014, 11:33 PM
  3. VBA Code to use variable value in Find and Select function
    By bensox in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2013, 08:03 AM
  4. Problem with an image an combo box
    By elio86 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-09-2013, 12:59 PM
  5. Image Load Error problem
    By homasa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-27-2010, 10:29 AM
  6. image with variable name problem
    By jamielill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 05:21 PM
  7. Image printing problem
    By tqm1 in forum Excel General
    Replies: 5
    Last Post: 04-27-2007, 09:39 AM

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