Private Sub Worksheet_Change(ByVal Target As Range)
Dim Picture As Object
If Target.Cells.Count > 1 Then Exit Sub
With Target.Offset(0, 1)
Set Picture = Nothing
On Error Resume Next
Set Picture = Sheets("SMW").Pictures.Insert(ActiveWorkbook.Path & "\" & Target.Value & ".jpg")
Picture.Top = .Top
Picture.Left = .Left
Picture.ShapeRange.LockAspectRatio = msoFalse
Picture.Placement = xlMoveAndSize
Picture.ShapeRange.Width = 50
Picture.ShapeRange.Height = 44
End With
End Sub
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment