Hello.
I am trying to run a code that after reading the value of cell "A:2" must display a picture in the active worksheet.
This is my code:
However, by the moment I am facing to problems when running the code :
1. the code vba displays "Error 424 Object Required" for line: "If Intersect(Target, Range("A2")) Is Nothing Then"
2. VBA coloured in red my relative path in line:Set myPict = Range("AI7:J17").Parent.Pictures.InsertCurrentProject.Path\BDR\Pictures\ & Target.Value & ".jpg")
So, any help would be greatly appreciated.
I am trying to run a code that after reading the value of cell "A:2" must display a picture in the active worksheet.
This is my code:
Code:
Public Sub insertpicture()
If Intersect(Target, Range("A2")) Is Nothing Then
Exit Sub
End If
Dim myPict As Picture
With Range("A20:J20")
'Set myPict = Range("A20:J20").Parent.Pictures.InsertCurrentProject.Path\BDR\Pictures\ & Target.Value & ".jpg")
myPict.Top = .Top
myPict.Width = .Width
myPict.Height = .Height
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With
End Sub
However, by the moment I am facing to problems when running the code :
1. the code vba displays "Error 424 Object Required" for line: "If Intersect(Target, Range("A2")) Is Nothing Then"
2. VBA coloured in red my relative path in line:Set myPict = Range("AI7:J17").Parent.Pictures.InsertCurrentProject.Path\BDR\Pictures\ & Target.Value & ".jpg")
So, any help would be greatly appreciated.