Picture in A1, display picture in different cell via formula?

Windy Skies

New Member
Joined
Dec 27, 2012
Messages
47
Hi,

Say I have an image in cell A1, how would I display that image in a different cell using a formula? I would like to do this to more easily (or at all) use the images in an =vlookup formula.

Background:

I've added thousands of pictures into an excel file using this macro I've found on the internet. The Excel file is still only 200kb so they must be linked somehow. The images do not have useful file names, so I will have to add useful sorting information manually:
Code:
Sub InsertPictures()
     
    Dim Pict() As Variant
    Dim ImgFileFormat As String
    Dim PictCell As Range
    Dim lLoop As Long
    Dim sShape As Picture
     
    ActiveSheet.Protect False, False, False, False, False
    ImgFileFormat = "All Picture Files(*.emf;*.wmf;*.jpg;*.jpeg;*.jfif;*.jpe;*.png;*.bpm;*.gif;*.gfa;*.emz;*.wmz;*.pcz;*.tif;*.tiff;*.cgm;*.eps;*.pct;*.pict;*.wpg;*.pcd;*.pcx;*.cdr;*.fpx;*.mix), *.bmp"
     
     'Note you can load in any nearly file format
    Pict = Application.GetOpenFilename(ImgFileFormat, MultiSelect:=True)
    If Not IsArray(Pict) Then
        Debug.Print "No files selected."
        Exit Sub
    End If
     
    Set PictCell = Selection.Cells(1)
    For lLoop = LBound(Pict) To UBound(Pict)
         
        Set sShape = ActiveSheet.Pictures.Insert(Pict(lLoop))
         
        With sShape
            If .Height < 408.75 Then
                PictCell.EntireRow.RowHeight = .Height
            End If
             '       If .Width < 254 Then
             '           PictCell.EntireColumn.ColumnWidth = .Width
             '       End If
            .Top = PictCell.Top
            .Left = PictCell.Left
        End With
        Set PictCell = PictCell.Offset(1)
    Next lLoop
     
End Sub
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Watch MrExcel Video

Forum statistics

Threads
1,122,717
Messages
5,597,729
Members
414,169
Latest member
Preston_Cleric

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top