+ Reply to Thread
Results 1 to 2 of 2

Display Image Based On Image Name In Cell

  1. #1
    Registered User
    Join Date
    01-17-2011
    Location
    Wiltshire, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Display Image Based On Image Name In Cell

    I have 8 images and when their name is displayed in a cell Sheet1!C3 I want the image of the same name diplayed in sheet 2. I searched around and found a topic using an image control but couldnt get it to work, I am using Excel 2007 if that helps.

    Can anyone help me with a simple(ish) answer

    Thanks in advance
    Last edited by processchip; 02-01-2011 at 12:45 PM.

  2. #2
    Registered User
    Join Date
    01-17-2011
    Location
    Wiltshire, England
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Display Image Based On Image Name In Cell

    Hi all

    I have solved the initial problem with the code below

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target <> Range("A1") Then Exit Sub
    Select Case Target
    Case "#1": Image1.Picture = LoadPicture("c:\images\1.bmp")
    Case "#2": Image1.Picture = LoadPicture("c:\images\2.bmp")
    Case "#3": Image1.Picture = LoadPicture("c:\images\3.bmp")
    End Select
    End Sub
    Last edited by processchip; 02-01-2011 at 12:47 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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