- 帖子
- 967
- 主題
- 0
- 精華
- 0
- 積分
- 1001
- 點名
- 0
- 作業系統
- WIN XP
- 軟體版本
- OFFICE 2003
- 閱讀權限
- 50
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-11-29
- 最後登錄
- 2022-5-17
 
|
2#
發表於 2012-2-7 22:36
| 只看該作者
回復 1# g93353
先調整好B欄的欄寬列高(照片的大小)- Sub PHOTO()
- ActiveSheet.Columns("C") = ""
- Set Sh = ActiveSheet
- With Sh
- .Pictures.Delete
- End With
- fs = Dir("D:\TEST\*.jpg")
- Do Until fs = ""
- R = R + 1
- Cells(R, 3) = fs
- Cells(R, 2).Select
- ActiveSheet.Pictures.Insert("D:\TEST\" & Cells(R, 3)).Select
- With Selection
- .Top = ActiveSheet.Cells(R, 2).Top + 1
- .Left = ActiveSheet.Cells(R, 2).Left + 1
- .Width = ActiveSheet.Cells(R, 2).Width - 1
- .Height = ActiveSheet.Cells(R, 2).Height - 1
- End With
- fs = Dir
- Loop
- End Sub
複製代碼 |
|