Excel VBA: Insert Picture from Directory on Cell Value Change Without Error Youtube Link : https://youtu.be/3BJaYVOy4TM Code : This Code paste in Active sheet Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = False Dim myPict As Picture Dim PictureLoc As String If Target.Address = Range("b3").Address Then ActiveSheet.Pictures.Delete PictureLoc = " PICTURE LOCATION " & Range("b3").Text & ".jpg" With Range("g3") On Error GoTo errormessage: Set myPict = ActiveSheet.Pictures.Insert(PictureLoc) myPict.Height = 300 myPict.Width = 200 myPict.Top = .Top myPict.Left = .Left myPict.Placement = xlMoveAndSize myPict.ShapeRange.LockAspectRatio = msoTrue errormessage: If Err.Number = 1004 Then MsgBox "File does not Exist, Please first update photo with .jpg File" End If End With End If Application.ScreenUpdating = True End Sub
Popular posts from this blog
Excel VBA: Insert Multipul Picture from Directory on Cell Value Change Without
Excel VBA: Insert Multipul Picture from Directory on Cell Value Change Without Error Youtube Link : https://youtu.be/pqpVp01sWB0 Code : This Code paste in Active sheet Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = False If Range("b3") .Select Then Dim myPict As Picture Dim PictureLoc As String If Target.Address = Range("b3") .Address Then ActiveSheet.Pictures.Delete PictureLoc = "D:\\FLIPKART\PHOTO\" & Range("b3") .Text & ".jpg" With Range("b5") On Error GoTo errormessage: Set myPict = ActiveSheet.Pictures.Insert(PictureLoc) myPict.Height = 300 myPict.Width = 200 myPict.Top = .Top ...














This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by the author.
Delete