Sub 添加图片()
On Error Resume Next
Dim lujing As String
For i = 1 To 11
For j = 1 To 20
lujing = ThisWorkbook.Path & "\影相\" & Sheet2.Cells(j, i).Value & ".jpg"
j = j + 1
With Sheet2
.Cells(j, i).Select
.Shapes.AddPicture lujing, _
True, True, _
Cells(j, i).MergeArea.Left, _
Cells(j, i).MergeArea.Top, _
Cells(j, i).MergeArea.Width, _
Cells(j, i).MergeArea.Height
End With
Next j
Next i
End Sub
Sub 删除图片()
ActiveSheet.Pictures.Delete
End Sub
留个记号以免以后忘记。
|