Sub InsertPic()
Dim i As Long, sPath As String, sfileName As String
sPath = "D:\pic\"
Application.ScreenUpdating = False
On Error Resume Next
With ThisWorkbook.Sheets("Sheet1")
For i = 1 To 256
If .Cells(1, i) <> "" Then
sfileName = sPath & .Cells(1, i) & ".jpg"
Cells(2, i).Select
.Pictures.Insert (sfileName)
If Err <> 0 Then
MsgBox .Cells(1, i) & ".jpg" & "不存在"
Err = 0
End If
End If
Next i
End With
Application.ScreenUpdating = True
Range("A1").Select
End Sub
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。