Sub test()
Dim rg As Range, shp As Shape
Rem ---------------------------------------------------
Rem 清除图形对象
For Each shp In ActiveSheet.Shapes
shp.Delete
Next
Rem ---------------------------------------------------
Rem 按名称插入图片
Rem 下行代码,根据A列开始循环处理
For I = To Cells(Rows.Count, "A").End().Row
Set rg = Cells(I, "B")
Rem 下面代码,添加矩形
ActiveSheet.Shapes.AddShape(msoShapeRectangle, rg.Left, rg.Top, rg.Width, rg.Height).Select
Rem 下面代码,在矩形内部用图片填充
Selection.ShapeRange.Fill.UserPicture rg.Offset(, -).Value
Next
End Sub
按ALT+F8运行该宏