这个问题可以解决,是用宏来解决的,图片放在相应的文件夹里面,你把文件发到我的邮箱里面。
nbwyong@126.com
在A列是图片名称,在B列自动添加图片,把所有图片放在photo文件夹下。
Sub photo()
Dim i As Integer
Dim FilPath As String
Dim rng As Range
Dim s As String
With Sheets("sheet1")
For i = 2 To .Range("a65536").End(xlUp).Row
FilPath = ThisWorkbook.Path & "\photo\" & .Cells(i, 1).Text & ".jpg"
If Dir(FilPath) <> "" Then
.Pictures.Insert(FilPath).Select
Set rng = .Cells(i, 2)
With Selection
.Top = rng.Top + 1
.Left = rng.Left + 1
.Width = rng.Width - 1
.Height = rng.Height - 1
End With
Else
s = s & Chr(10) & .Cells(i, 2).Text
End If
Next
.Cells(3, 1).Select
End With
If s <> "" Then
MsgBox s & Chr(10) & "没有照片!"
End If
End Sub