Hey there.
I am new here (and new to macros!), but have a pretty good Excel knowledge. I am hoping someone can help me decipher this little challenge to display some nice thumbnail images in my worksheet!! Its been killing me!
I am trying to find a macro that I can use in VBA to take a column of URL links (B2:B103) and display the images in the next column at cells C2:C203. The URLs are all direct links to photos that are uniformly sized.
Example here: https://secure-i2.ztat.net//detail/C...default__2.jpg
I have found the below code, which I have inserted in a new Module using VBA and Run as a Macro - but this is not doing what I need in Excel for Mac 2011. It does all the column, row formatting etc perfectly, but it does not do the most important thing - i.e. display the image!! :-(
Sub IMAGE()
Dim Rng As Range
Dim Cell As Range
Dim Pic As Picture
Application.ScreenUpdating = False
Columns("J:J").ColumnWidth = 21.29
Set Rng = Range("K2:K" & Range("k" & Rows.Count).End(xlUp).Row)
For Each Cell In Rng
With Cell
On Error Resume Next
Set Pic = .Parent.Pictures.Insert(.Value)
If Err <> 0 Then
Err.Clear
Else
With .Offset(, -1)
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = .Height
Pic.Width = .Width
End With
End If
On Error GoTo 0
End With
Next Cell
Rng.EntireRow.RowHeight = 120
Application.ScreenUpdating = True
End Sub
It seems a common issue. I wonder if there is some kind of missing functionality in Excel for Mac 2011? In fact, I have found no method whatsoever in Excel for Mac 2011 to insert an image directly from a URL location. Even the [Insert > Photo > Picture from file... > Choose a picture] dialogue box does not seem to accommodate a pasted file location, one can only click and select a local file from the file menu.
Can anyone please help me with this?
Thanks so much. :-)
Bookmarks