返回列表 上一主題 發帖

圖片匯入問題

回復 1# g93353

先調整好B欄的欄寬列高(照片的大小)
  1. Sub PHOTO()
  2. ActiveSheet.Columns("C") = ""
  3. Set Sh = ActiveSheet
  4. With Sh
  5.     .Pictures.Delete
  6. End With
  7. fs = Dir("D:\TEST\*.jpg")
  8. Do Until fs = ""
  9.    R = R + 1
  10.    Cells(R, 3) = fs
  11.    Cells(R, 2).Select
  12.    ActiveSheet.Pictures.Insert("D:\TEST\" & Cells(R, 3)).Select
  13.    With Selection
  14.        .Top = ActiveSheet.Cells(R, 2).Top + 1
  15.        .Left = ActiveSheet.Cells(R, 2).Left + 1
  16.        .Width = ActiveSheet.Cells(R, 2).Width - 1
  17.        .Height = ActiveSheet.Cells(R, 2).Height - 1
  18.    End With
  19.    fs = Dir
  20. Loop
  21. End Sub
複製代碼

TOP

        靜思自在 : 人的心地是一畦田,土地沒有播下好種子,也長不出好的果實。 -
返回列表 上一主題