|
- Sub Main()
- 'Date:2018/7/2 五月十九 Monday
- 'Application.DisplayAlerts = False
- 'ThisWorkbook.Save
- 'Application.DisplayAlerts = True
- Dim shp As Shape
- For Each shp In Sheet1.Shapes
- If shp.TopLeftCell.Row > 6 And shp.TopLeftCell.Row < 35 Then
- If shp.TopLeftCell.Column > 0 And shp.TopLeftCell.Column < 15 Then
- shp.Delete
- End If
- End If
- Next
- Filename = ThisWorkbook.Path
- ar = Array(2, 6, 11)
- With Sheet1
- For j = 0 To 1
- For i = 0 To 2
- k = k + 1
- picpath = Filename & "\车辆图片" & .Range("h4").Value & "" & .Range("h4").Value & " (" & k & ").JPG"
- If Len(Dir(picpath)) Then
- Set shp = .Shapes.AddShape(msoShapeRectangle, Cells(8 + j * 13, ar(i)).MergeArea.Left + 1, Cells(8 + j * 13, ar(i)).MergeArea.Top + 1, Cells(8 + j * 13, ar(i)).MergeArea.Width - 1, Cells(8 + j * 13, ar(i)).MergeArea.Height - 1)
- shp.Fill.UserPicture picpath
- shp.Line.Visible = msoFalse
- Set shp = Nothing
- Else
- MsgBox "没找到 " & picpath
- End If
- Next
- Next
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|