• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Images in another Folder

S P P

Member
Images in another Folder


With this code it works with images in the same folder as the spreadsheet

>>> use code - tags <<<
Code:
With Planilha1
If Not Intersect(Target, .Range("A2")) Is Nothing Then
.Image1.Picture = LoadPicture(Application.ThisWorkbook.Path & "\" & .Range("A2").Cells & ".Jpg")
End If
End With

How to modify the code with the images in another folder.
 
Last edited by a moderator:
Replace Application.ThisWorkbook.Path with the path you want - e.g. "C:\some folder\pictures"
 
I did this in case I needed to change

>>> use code - tags <<<
Code:
Dim Path As String
Path = "C:\"
With Planilha1
If Not Intersect(Target, .Range("A2")) Is Nothing Then
.Image1.Picture = LoadPicture(Path & "\" & .Range("A2").Cells & ".Jpg")
End If
End With
 
Last edited by a moderator:
Back
Top