เพื่อมุ่งให้เกิดคุณภาพจากการอบรมสูงสุด Excel Expert Training ให้การอบรม Excel กลุ่มเล็กๆ ไม่เกิน 6 คนทุกคนสามารถเรียนรู้ Excel อย่างใกล้ชิด จะมาคนเดียวหรือมาเป็นกลุ่มแล้วนัดวันอบรมแบบส่วนตัวก็ได้
ผู้เข้าอบรมทุกคนสามารถติดตามเนื้อหาที่อบรมได้อย่างชัดเจนจากจอภาพด้านหน้าของตัวเอง
-
เจอ code เกี่ยวกับการดึงภาพ

Originally Posted by
orange_soi9
ลองศึกษาและพยายามเขียน Code ด้วยตัวเองขึ้นมาก่อนดีไหมคะ? ถ้าลองพยายามทำแล้ว แต่ติดขัดปัญหาตรงไหนค่อยมาถามอีกทีนะคะ อาจารย์และทุกคนในที่นี้พร้อมช่วยอยู่แล้วค่ะ :smile:
ลองดู Code จาก Link นี้เป็นตัวอย่างก่อนก็ได้นะคะ
http://excel.bigresource.com/auto-in...-VrrpomxW.html
เจอ code เกี่ยวกับการดึงภาพ แต่มาประยุกต์ไม่เป็นค่ะ คือ code ที่พี่เขาช่วยดูให้ทดลองทำแล้วก็บอกว่า ภาพมาอยู่ในตำแหน่งที่กำหนด แต่อ้อยทดลองทำที่เครื่องหลายต่อหลายครั้งก็ยังไม่สำเร็จค่ะ
เห็น code นี้อยู่เห็นมีการกำหนด ActiveSheet.Range("c3:d9")
คิดว่าของเราน่าจะกำหนดดูบาง แต่พอไปทำไม่ได้ผลเลย มึนกำลังสองเลยค่ะ
Option Explicit
'With the macro below you can insert pictures and fit them to any range in a worksheet.
Option Explicit
Sub InsertPicInRange()
With Application
.ScreenUpdating = False
Dim picToOpen As String
picToOpen = .GetOpenFilename("Pics (*.bmp), *.bmp")
If picToOpen <> "" Then
InsertPictureInRange picToOpen, ActiveSheet.Range("c3:d9")
End If
.ScreenUpdating = True
End With
End Sub
Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range)
' inserts a picture and resizes it to fit the TargetCells range
Dim p As Object, t As Double, l As Double, w As Double, h As Double
If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
If Dir(PictureFileName) = "" Then Exit Sub
' import picture
Set p = ActiveSheet.Pictures.Insert(PictureFileName)
' determine positions
With TargetCells
t = .Top
l = .Left
w = .Offset(0, .Columns.Count).Left - .Left
h = .Offset(.Rows.Count, 0).Top - .Top
End With
' position picture
With p
.Top = t
.Left = l
.Width = w
.Height = h
End With
Set p = Nothing
End Sub
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules