返回列表 上一主題 發帖

[發問] 如何匯入不特定的圖片檔

本帖最後由 oobird 於 2012-5-4 00:30 編輯
  1. Private Sub CommandButton1_Click()
  2.     Dim shp As Shape, c As Range
  3.     On Error Resume Next
  4.     For Each shp In ActiveSheet.Shapes
  5.         If Not shp.Type = 12 Then shp.Delete
  6.     Next

  7.     For Each c In Range("b2", [b65536].End(3))
  8.         On Error Resume Next
  9.         c(1, 2).Select
  10.         Set p = ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\TEST16\" & c & ".gif")
  11.         With p
  12.             .Name = c.Value
  13.             .Height = c(1, 2).Height
  14.             .Width = c(1, 2).Width
  15.             .Placement = xlMoveAndSize
  16.          End With
  17.     Next

  18. End Sub
複製代碼

TOP

        靜思自在 : 一個缺口的杯子,如果換一個角度看它,它仍然是圓的。
返回列表 上一主題