shahin
Active Member
Is there any way I can use dictionary (key, value pair) in the below script so that it can look for the key and it's value whether it is present as in, if any image is already present, it will skip that and if not then parse the image? The script can parse the image if I run it but the problem with it is: it again parses the image if I run again and so on even though scraped pictures are already there.
Placing these in Range(B2:B5) and the output will be reflected in the adjacent cells which means Range("C2:C5").
https://pic.yify-torrent.org/20170824/55408/lowriders-2017-1080p-poster.jpg
https://pic.yify-torrent.org/20170824/55407/wind-chill-2007-1080p-poster.jpg
https://pic.yify-torrent.org/20170824/55406/serial-mom-1994-1080p-poster.jpg
Code:
Sub PlacingImages()
Dim img As String, pics As Picture, cel As Range
For Each cel In Range("C2", Range("B2").End(xlDown).Offset(0, 1))
img = cel.Offset(0, -1)
Set pics = Sheets("Sheet1").Pictures.Insert(img)
With pics
.ShapeRange.LockAspectRatio = msoFalse
.Width = cel.Width
.Height = cel.Height
.Top = Rows(cel.Row).Top
.Left = Columns(cel.Column).Left
End With
Next cel
End Sub
Placing these in Range(B2:B5) and the output will be reflected in the adjacent cells which means Range("C2:C5").
https://pic.yify-torrent.org/20170824/55408/lowriders-2017-1080p-poster.jpg
https://pic.yify-torrent.org/20170824/55407/wind-chill-2007-1080p-poster.jpg
https://pic.yify-torrent.org/20170824/55406/serial-mom-1994-1080p-poster.jpg
Last edited: