ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ·s¤âµo°Ý¦³Ãö¬¡­¶¤¤ªº¹Ï¤ù¾Þ§@

¦^´_ 5# baconbacons
¸Õ¸Õ³o­Ó¡G
  1. Sub Ex2()
  2.     Dim myFSO As New FileSystemObject
  3.     Dim myPath As String, myPic As Object
  4.     Dim myPhoto As String, countPhoto As Long       '  countPhoto As String
  5.     Dim picNumRng As Object
  6.     Dim k As Integer

  7.     myPath = ThisWorkbook.Path                                                                                            '  ½T»{¬¡­¶Ã¯©Ò¦b¸ô®|
  8.     countPhoto = myFSO.GetFolder(myPath & "\" & "­ì©l¬Û¤ù").Files.Count          '  ¨ú±o¬Û¤ù¼Æ¶q
  9.     myPhoto = Dir(myPath & "\" & "­ì©l¬Û¤ù" & "\" & "*.jpg")
  10.    
  11.     If myPhoto <> "" Then                                                                                                           '  ¸ê®Æ§¨¤¤¦³¬Û¤ù®É½Æ»sªí®æ
  12.         For k = 1 To countPhoto                                                                                                   '  ¿é¤J¬Û¤ù½s¸¹
  13.             Set picNumRng = Range("A" & (25 * (k - 1) + 5 - Application.WorksheetFunction.RoundUp((k - 1) / 2, 0)))
  14.             
  15.             ActiveSheet.Pictures.Insert (myPath & "\" & "­ì©l¬Û¤ù" & "\" & myPhoto)              '  ´¡¤J»PÀx¦s®æ¦P¦Wªº¬Û¤ùÀÉ
  16.             With ActiveSheet.Shapes(k)
  17.                 .LockAspectRatio = msoFalse
  18.                 .Top = picNumRng.Top
  19.                 .Left = picNumRng.Left
  20.                 .Width = 75
  21.                 .Height = 100
  22.             End With
  23.             myPhoto = Dir
  24.         Next
  25.     Else
  26.         MsgBox "¸ê®Æ§¨¤¤¨S¦³¬Û¤ù"
  27.     End If
  28. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD