|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub charutupian()
For Each sp In ActiveSheet.Pictures
sp.Delete
Next sp
r = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To r Step 3
If Trim(ActiveSheet.Cells(i, 3)) <> "" Then
f = Dir(ActiveSheet.Cells(i, 3))
If f <> "" Then
ActiveSheet.Range("e" & i & ":e" & i + 2).Select
ActiveSheet.Pictures.Insert(ActiveSheet.Cells(i, 3)).Select
With Selection.ShapeRange
Selection.ShapeRange.LockAspectRatio = msoFalse
.Top = ActiveSheet.Range("e" & i & ":e" & i + 2).Top + 1
.Left = ActiveSheet.Range("e" & i & ":e" & i + 2).Left + 1
.Width = ActiveSheet.Range("e" & i & ":e" & i + 2).Width
.Height = ActiveSheet.Range("e" & i & ":e" & i + 2).Height
End With
End If
End If
Next i
MsgBox "ok!"
End Sub
|
|