+ Reply to Thread
Results 1 to 4 of 4

macro to insert a picure based on cell value

  1. #1
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    macro to insert a picure based on cell value

    Hi

    I'm trying to set up a sheet that will insert a picture in a cell (F4 for example) based on the value of another cell like B4

    I've tried a couple of things but am not getting anywhere. I have 4 different pictures that I want to use.

    Can anyone please help?

    This is for Excel 2007

    thanks
    Last edited by BillDoor; 10-23-2014 at 03:58 AM. Reason: update info

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: macro to insert a picure based on cell value

    Hi,

    Insert this sub to your module :

    Please Login or Register  to view this content.
    Then you can call this sub using syntax like this :

    Please Login or Register  to view this content.
    Last edited by karedog; 10-23-2014 at 06:46 AM. Reason: Make the code compatible for Excel 2010++
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    Re: macro to insert a picure based on cell value

    thanks, but excuse my ignorance with this, I can't see what to change in this to link to the picture files I have, can you please explain the code a little?

    thanks again

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: macro to insert a picure based on cell value

    The LoadPic sub take 2 arguments, first is the filename of the picture, second is the range you want to put the picture.

    So lets say the the cell D4 on Sheet1 content is C:\Pic1.jpg and you want to put this picture at cell F4 on Sheet2, you call this sub by using this statement :

    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. Insert a value in a cell based on what macro is run
    By katkth7533 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-03-2014, 02:48 PM
  2. [SOLVED] Excel Macro, VBA help needed - Insert Cell based on value of a cell in another column
    By alw99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-03-2014, 05:22 PM
  3. [SOLVED] Event Macro to insert text in cell based on input of another cell
    By nplouffe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2012, 11:54 AM
  4. Need help with insert row macro based on cell criteria
    By RAK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2009, 12:18 AM
  5. How do i add an avatar picure?
    By Hlki in forum Excel General
    Replies: 2
    Last Post: 02-04-2008, 11:16 PM

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