+ Reply to Thread
Results 1 to 4 of 4

Macro to Insert Picture depending on cell detail

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    York, UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to Insert Picture depending on cell detail

    Hi,

    I'm not sure if what I'm trying to do is possible so I'm hoping someone can at least answer that.

    I have a spreadsheet with a list of Brands in column A and each brand has a logo. The logo needs to go in column B depending on which Brand is in column A. So far, this is being done by copying and pasting the image for each brand but this is proving quite time consuming!

    Is there any way of creating a macro/ process to do this?

    If anyone can advise, that would be a great help!

    Thanks,
    Lewis

  2. #2
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: Macro to Insert Picture depending on cell detail

    http://excel.tips.net/T003128_Displa..._a_Result.html

    This explains it quite well. I guess it probably depends on what foremat you have the logo's in but it looks fairly simple.

  3. #3
    Registered User
    Join Date
    07-01-2013
    Location
    York, UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to Insert Picture depending on cell detail

    Hi Brendan,

    Good effort! Unfortunately this method will only change the picture on 1 row. So for example, if cell A1 says Apple, it'll be a picture of an apple; or if it say Orange, it's a picture of an Orange - it can't be transferred onto other rows (well it can but it would be as easy to copy and paste the image you want, which is what I'm currently doing).

    Adopting the idea of fruits above, my spreadsheet has Orange in A1, Apple in A2, Pear in A3, Pear in A4, Apple in A5 (and so on) and I need to put the corresponding picture into B1, B2, B3 etc.

    Thanks for your idea though, a definte good suggestion!
    Lewis

  4. #4
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: Macro to Insert Picture depending on cell detail

    I think you are going to have to go the UDF route. Name the logo's as what is in the column being looked up, amend the directory and file extension accordingly and add =showpic(lookup_value). Width and height currently set to 200. Assuming the lookupvalue is the same as the filename it will return the picture.

    You can copy the =showpic(lookup_value) down the sheet.



    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. Macro to insert cell values in another sheet depending on value and format
    By adw223 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2013, 03:57 PM
  2. VBA for Picture insert at particular worksheet range. Picture name derived from cell.
    By Douglas2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2013, 01:16 AM
  3. Creating macro to insert a picture by including specific picture name & path
    By NissaFrenchRamsteyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2012, 05:40 AM
  4. macro: insert specified number of rows depending on referenced cell value
    By cffurillo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2012, 11:37 AM
  5. [SOLVED] macro: insert picture based on workbook location, not picture root path.
    By NicksDad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2012, 07:47 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