I am trying to insert images in column F by urls in column C
Code: Select all
Sub Insert_Images_By_URL()
Dim sURL As String, lr As Long, r As Long
With ActiveSheet
lr = .Cells(.Rows.Count, "F").End(xlUp).Row
For r = 1 To lr
With .Cells(r, "F")
If .Value <> Empty Then
sURL = "https://logo.clearbit.com/" & .Offset(, -3).Value & ".com"
With .Parent.Pictures.Insert(sURL)
.ShapeRange.LockAspectRatio = msoTrue
.Top = .Top
.Left = .Left
.Width = .Width
.Height = .Height
End With
End If
End With
Next r
End With
End Sub