
Sub InsertPicture()
Dim MyShape As Shape
Dim r As Integer
Dim c As Integer
Dim PicPath As String
Dim Picrng As Range
With Sheet1
For Each MyShape In Shapes
If MyShapeType = 13 Then
MyShapeDelete
End If
Next
For r = 2 To Cells(RowsCount, 1)End(xlUp)Row
For c = 1 To 8 Step 2
PicPath = ThisWorkbookPath & "\" & Cells(r, c)Text & "jpg"
If Dir(PicPath) <> "" Then
Set MyShape = ShapesAddPicture(PicPath, False, True, 6, 6, 6, 6)
Set Picrng = Cells(r, c + 1)
With MyShape
LockAspectRatio = msoFalse
Top = PicrngTop + 1
Left = PicrngLeft + 1
Width = PicrngWidth - 15
Height = PicrngHeight - 15
TopLeftCell = ""
End With
Else
Cells(r, c + 1) = "暂无照片"
End If
Next
Next
End With
Set MyShape = Nothing
Set Picrng = Nothing
End Sub
效果如下图:
>
系统自带的画图工具,粘贴的方法有两种: 第一种方法: 1、打开画图软件,如下图: 2、点击粘贴,如下图: 3、点击粘贴来源--选择要粘贴的图像。 第二种方法: 1、复制要粘贴的图像。 2、点击粘贴--粘贴。
以上就是关于用Excel从一个文件夹内取出图片,再进行定位并插入图片全部的内容,包括:用Excel从一个文件夹内取出图片,再进行定位并插入图片、excel表格里面的图片怎么取出来、Excel 如何精确定位图片粘贴位置等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)