Sub Test() On Error Resume Next Dim Rng As Range Dim Cell As Range Dim Pic As Picture Application.ScreenUpdating = False Set Rng = Range("C1:C" & Range("c" & Rows.Count).End(xlUp).Row) For Each Cell In Rng With Cell Set Pic = .Parent.Pictures.Insert(.Value) With .Offset(, -1) Pic.Top = .Top Pic.Left = .Left Pic.Height = .Height Pic.Width = .Width End With End With Next Cell Application.ScreenUpdating = True End Sub
操作步骤:
1. 新增一列辅助列放图片地址
2. 图片会被插入在辅助列的前一列中,因为前一列的大小影响到图片的显示大小
3. 执行完处理完毕后,删除辅助列即可
VBA 根据链接插入图片到Excel,布布扣,bubuko.com
原文:http://www.cnblogs.com/Linky/p/3582220.html