Hi syl,
Welcome to the forum!!
There's no need to loop that part of your code at all:
Sub GetShapeFromWeb()
On Error GoTo errormsg
Dim var As String
Dim lngvar As Long
Dim LR As Long
Dim x As Long
Application.ScreenUpdating = False
LR = Cells(Rows.Count, 1).End(xlUp).Row '<- This sets the LR variable from the last row in Col. A yet the code below loops through Col. L???
For x = 2 To LR
If Len(Cells(x, 12).Value) >= 7 And Len(Cells(x, 12).Value) <= 12 Then
var = Application.WorksheetFunction.Rept("0", 13 - Len(Cells(x, 12).Value)) & Cells(x, 12).Value
Else
var = Cells(x, 12).Value
End If
Call InsertShape("http//wwwwebsitecom/" & var & ".jpg", Sheet1.Range("B2").End(xlUp).Offset(x - 1, 0))
Next x
Call FitAllPics.FitAllPics
Application.ScreenUpdating = True
Exit Sub
errormsg:
Application.ScreenUpdating = True
End Sub
I also made some other changes and queried why you set the LR variable from Col. A yet your code is scrolling down Col. L??
Regards,
Robert