ต้องการ INSERT รูปภาพจาก Folder เข้ามาใน Excel เพิ่มเติม บริเวณสีน้ำเงินคอลัมภ์ G สามารถดึงภาพมาแสดงได้แล้วโดยอ้างอิงจากคอลัมภ์ F ถ้าผมอยากให้ดึงรูปมาแสดงเพิ่มในคอลัมภ์ K โดยอ้างอิงจากคอลัมภ์ J ไม่ทราบว่า จะต้องแก้ไขหรือเพิ่มเติม CODE อย่างไรครับ
Sub ShowPicture()
Dim r As Range, ra As Range
Book3.xlsm
Dim imgIcon As Object
Dim obj As Object
On Error Resume Next
With Worksheets("Sheet1")
Set ra = .Range("G4", .Range("F65536").End(xlUp).Offset(0, 1))
End With
For Each obj In ActiveSheet.Shapes
If Left(obj.Name, 4) = "Pict" Then
obj.Delete
End If
Next obj
For Each r In ra
Set imgIcon = ActiveSheet.Shapes.AddPicture( _
Filename:="D:\Test the end year party card\" & r.Offset(0, -1).Value & ".bmp", LinkToFile:=False, _
SaveWithDocument:=True, Left:=r.Left, Top:=r.Top, _
Width:=r.Width, Height:=r.Height)
Next r
End Sub
You do not have the required permissions to view the files attached to this post.