hello i try fixing to void run time error 1004 because if in cell is empty show the error in col a any cell contain name so bring the picture in col b but if col a is empty then shows error i try use vba handler but i failed and still the error show
i would truly appreciate if anybody correct me
this is my code
CPrivate Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("A:A")) Is Nothing Then Exit Sub
Dim myPict As Picture
With Cells(Target.Row, "b")
On Error GoTo Err_Handler
Set myPict = Cells(Target.Row, "b").Parent.Pictures.Insert("C:\Users\OSE\Desktop\" & Target.Value & ".jpg")
myPict.Top = .Top
myPict.Width = .Width
myPict.Height = .Height
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With
Exit_Sub:
Range("A2").Select
Application.ScreenUpdating = True
Exit Sub
Err_Handler:
MsgBox "Error encountered. " & Err.Description, vbCritical, "Error"
GoTo Exit_Sub
End Sub