• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Grabbing a graphic from a URL and putting into Excel

If you've got a list of the URL's in col A, this would load up the images fairly quickly.
Code:
Sub LoadImages()
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
'Starting at row 1...
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
  .Height = 72 * 4.35 '72 pixels per inch
  
  image_column.Cells(i).EntireRow.RowHeight = .Height
  End With
Next
End Sub

Shamelessly copied from here: http://stackoverflow.com/a/6312837
 
Luke - Your shameless copying was a great success! I made a few tweaks and it works like a charm. Incredible. Is there anything Excel can't do?? Thank you.
 
Yes, those are good points, SirJB7. Excel didn't make my coffee this morning or pee the dog in single-digit temperature. If only life had macros...
 
Back
Top