Leonvl
New Member
- Joined
- Apr 26, 2016
- Messages
- 20
I have used the following code to import images based on a URL in a cell range.
It allways worked untill recently. The problem is that if there is a blank field within the range, Excel quits immediately.
Not sure what to add to skip cells that do not have a value within the range?
Thanks, Leon
It allways worked untill recently. The problem is that if there is a blank field within the range, Excel quits immediately.
Not sure what to add to skip cells that do not have a value within the range?
Thanks, Leon
VBA Code:
Sub InsImg2()
Dim URL As Range
For Each URL In Worksheets("Sheet1").Range("A16:C16")
With URL.Parent.Pictures.Insert(URL.Value)
On Error Resume Next
.Left = URL.Offset(0, 0).Left + 1
.Top = URL.Offset(0, 0).Top
End With
Next
End Sub