|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
代码如下。。。
Sub test()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
t = Timer
Application.ScreenUpdating = False
Dim wb As Workbook, sht As Worksheet, sh As Worksheet
Set wb = ThisWorkbook
Set sht = wb.Sheets("sheet1")
sht.Pictures.Delete
arr = sht.Range("e9", sht.Cells(Rows.Count, 5).End(3))
' On Error Resume Next
For i = 1 To UBound(arr)
If arr(i, 1) <> Empty Then
With sht.Pictures.Insert(arr(i, 1))
.Top = sht.Cells(i + 8, 6).Top
.Left = sht.Cells(i + 8, 6).Left
.Height = sht.Cells(i + 8, 6).RowHeight
.Width = sht.Cells(i + 8, 6).ColumnWidth
End With
If Err.Number <> 0 Then Debug.Print "图片地址错误,请检查。"
End If
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
MsgBox "共耗时:" & Format(Timer - t, "0.0000") & " 秒!!!", 64
End Sub
|
评分
-
1
查看全部评分
-
|