How to get images to appear in Excel given image url

calendar_today Asked Jun 10, 2011
thumb_up 18 upvotes
history Updated April 16, 2026

Question posted 2011 · +9 upvotes

I’m creating a csv file with one of the columns containing an url of an image (e.g., www.myDomain.com/myImage.jpg).
How I can get Excel to render this image?

Accepted answer +18 upvotes

Dim url_column As Range
Dim image_column As Range

Set url_column = Worksheets(1).UsedRange.Columns("A")
Set image_column = Worksheets(1).UsedRange.Columns("B")

Dim i As Long
For i = 1 To url_column.Cells.Count

  With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
  End With

Next

Excel VBA objects referenced (5)

  • Cells.Count — Count function (Microsoft Access SQL)
  • Cells.Count — Count the number of records in a DAO Recordset
  • Range — Refer to Cells by Using a Range Object
  • Range — Delete Duplicate Entries in a Range
  • UsedRange.Columns — Hide and Unhide Columns

Top excel Q&A (6)

+18 upvotes ranks this answer #33 out of 167 excel solutions on this site — top 20%.