|
- Sub Macro1()
- Dim mypath$, i&, j%, m As Shape
- mypath = ThisWorkbook.Path & ""
- For Each m In ActiveSheet.Shapes
- If m.Type <> 8 Then m.Delete
- Next
- For i = 2 To Range("a65536").End(xlUp).Row
- For j = 8 To 11
- x = Cells(i, j).Left: y = Cells(i, j).Top
- w = Cells(i, j).Width: h = Cells(i, j).Height
- ActiveSheet.Shapes.AddShape(msoShapeRectangle, x, y, w, h).Select
- Selection.ShapeRange.Fill.UserPicture mypath & Cells(1, j) & "" & Cells(i, 4) & ".jpg"
- Next
- Next
- End Sub
复制代码 |
|