+ Reply to Thread
Results 1 to 4 of 4

Placing images in cells using IF

  1. #1
    Registered User
    Join Date
    05-12-2016
    Location
    Canada
    MS-Off Ver
    Microsoft Office Famille et Étudiant 2019
    Posts
    28

    Placing images in cells using IF

    I know how to place images on a work sheet while using the command INSERT, but I was wondering if EXCEL allowed us to save specific images in cells and have those images appear with an IF formula. Here's what I have in mind. If I were to use TEAM LOGOS from the NHL (as an example) with IF, I would like to download all 30 logos, associate each logo with a specific cell, and build an IF formula that would say...

    =IF(B2=BOS;BRUINSLOGO;IF(B2=BUF;SABRESLOGO;IF(B2=CAL;FLAMESLOGO...

    And see those logo appear in that specific cell. Can it be done? If so, how? THX
    GO! WINGS! GO!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Placing images in cells using IF

    See if this will help?
    Assumption: Pictures are stored on Sheet2 and will be dynamically shown on Sheet1.

    Select Sheet2 and turn off Grid Lines
    • View...Uncheck: Grid Lines

    1) For each picture to be displayed:
    1a. Insert.Picture...(select picture and put it in the sheet).
    1b. Select the range of cells that is under the picture.
    1c. Name that range of cells, using the prefix "pic" followed by the dropdown list text:
    Example for a picture of an Elephant:
    Formulas.Name_Manager.New
    ...Name: picElephant
    ...Refers to: (this is whatever range you've selected under the elephant pic)

    2) Build your data validation list on a cell in Sheet1 and pick one of the items.

    3) Create a dynamic range name that refers to that cell:
    • Formulas.Name_Manager.New
    ...Name: ShowMyPic
    ...RefersTo: =INDIRECT("pic"&Sheet1!$A$1)
    or whatever cell you chose tha contains the dropdown list.

    4) Copy the range of cells under one of the pictures from Sheet2
    5) Select the display cell on Sheet1.
    6) Home.Paste.Paste.As_Picture.Picture_Link
    7) With the picture selected, type this in the formula bar, then press [Enter]:
    #NAME?

    The picture will be replaced by the picture referred to by the dropdown list.

    Each time you select a different item in the list, the associated picture will appear in the picture box and resize appropriately
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Placing images in cells using IF

    requires a lot of background setup in order to work

    here is one way of doing it
    http://trumpexcel.com/2013/11/pictur...-named-ranges/

    here is a video of it being done
    https://www.youtube.com/watch?v=wZMrOOU9iXs

    and the corresponding file and details
    http://exceltemplate.net/tutorial/ho...cell-contents/
    Last edited by humdingaling; 05-19-2016 at 11:48 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    09-01-2015
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Pro Plus 2010
    Posts
    33

    Re: Placing images in cells using IF

    Here is a small example file.
    Hope it works for you.
    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. [SOLVED] matching and placing in cells
    By gilnic in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-24-2016, 08:38 AM
  2. Replies: 2
    Last Post: 12-08-2014, 06:04 AM
  3. Placing multiple images anywhere on the sheet - Fun with VBA
    By xlbiznes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2014, 03:41 PM
  4. Cutting cells in one column and placing in another.
    By Faulky in forum Excel General
    Replies: 9
    Last Post: 10-22-2012, 09:51 PM
  5. Placing images at print area limits
    By GrahamMac in forum Excel General
    Replies: 0
    Last Post: 03-05-2010, 02:41 PM
  6. Placing borders around cells?
    By Terry Pinnell in forum Excel General
    Replies: 3
    Last Post: 02-14-2006, 07:35 PM
  7. Placing Workshet Name in cells
    By T De Villiers in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2005, 08:05 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