This is the code that i am using at the moment,

the path is located in A1

where would you add the code line?




Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim sh As Worksheet
Dim PcRng As Range
Dim rng As Range
Dim Filepath As String
Filepath = ActiveSheet.Range("A1").Value
Shell ("RunDLL32.exe C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen " & Filepath)

Set sh = Sheets("Accreditation")


If Target.Column <> 14 Then Exit Sub
If Target.Row < 4 Then Exit Sub


With sh
.Pictures.Delete
Set PcRng = .Range("S1:X13")
Set myRng = PcRng.Areas(1)
Set myPict = myRng.Parent.Pictures.Insert("filapath" & Target.Value & ".jpg")
myPict.Left = myRng.Left
myPict.Top = myRng.Top
myPict.Height = myRng.Height
myPict.Width = myRng.Width
myPict.Placement = xlMoveAndSize
End With

End Sub