|
楼主 |
发表于 2017-12-26 17:52
来自手机
|
显示全部楼层
Sub 图片()
On Error Resume Next
Dim MR As Range
For Each MR In Selection
If Not IsEmpty(MR) Then
MR.Select
ML = MR.Left
MT = MR.Top
MW = MR.Width
MH = MR.Height
ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
Selection.ShapeRange.Fill.UserPicture _
ActiveWorkbook.Path & "\" & MR.Value & ".jpg" '当前文件所在目录下以当前单元内容为名称的.jpg图片
End If
Next
End Sub
Sub 图片()
On Error Resume Next
Dim MR As Range
For Each MR In Selection
If Not IsEmpty(MR) Then
MR.Select
ML = MR.Left
MT = MR.Top
MW = MR.Width
MH = MR.Height
ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
Selection.ShapeRange.Fill.UserPicture _
ActiveWorkbook.Path & "\" & MR.Value & ".jpg" '当前文件所在目录下以当前单元内容为名称的.jpg图片
End If
Next
End Sub
|
|