在工作表中批量插入图片,只需动动你的手指
具体应用
Sub 批量插入图片()
Dim lj$, wjm$, n%
Dim r As Range, shp As Shape
For Each shp In Sheet1.Shapes
If shp.Type <> 8 Then shp.Delete
Next
lj = "F:\图片"
wjm = Dir(lj & "\")
Do While wjm <> ""
n = n + 1
Cells(n + 1, 1) = wjm
Set r = Cells(n + 1, 1).Offset(0, 1)
Sheet1.Shapes.AddPicture lj & "\" & wjm, True, True, _
r.Left, r.Top, r.Width, r.Height
wjm = Dir
Loop
End Sub
赞 (0)