Apr 19 2021 03:45 PM
Hello
I have a vba script i need help with, the script function as is, but when i come to and image url what don´t exist then the script halt. I wish so i can add if image url is not valid jump to next and so on.
Sub InstallPictures()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim url_column As Range
Dim image_column As Range
'column with url...
Set url_column = Worksheets(1).UsedRange.Columns("A")
'column where image will be inserted
Set image_column = Worksheets(1).UsedRange.Columns("B")
Dim i As Long
For i = 2 To url_column.Cells.Count
Set Picture = image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
Picture.Left = image_column.Cells(i).Left
Picture.Top = image_column.Cells(i).Top
Picture.Height = 40
image_column.Cells(i).EntireRow.RowHeight = 40
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Thanks in advance
LesBear
Apr 19 2021 03:49 PM
SolutionApr 19 2021 03:49 PM
Solution