Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo err
Dim Path$
If Target.Row < 5000 And Target.Column < 2 Then
Range("T2") = Cells(Target.Row, Target.Column)
End If
Worksheets("准考证").DrawingObjects.Delete
Path = ThisWorkbook.Path & "\pic\" & [t2] & ".jpg"
With Worksheets("准考证")
With .Pictures.Insert(Path)
.ShapeRange.Left = 340
.ShapeRange.Top = 80
.ShapeRange.Height = 140
.ShapeRange.Width = 110
End With
With .Pictures.Insert(Path)
.ShapeRange.Left = 340
.ShapeRange.Top = 465
.ShapeRange.Height = 140
.ShapeRange.Width = 110
End With
End With
Exit Sub
err: MsgBox "没有数据"
End Sub