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

[µo°Ý] ¦p¦ó±Nfile§¨¹ÏÀɤ@¦¸¥þ³¡±a¤Jexcelªí®æ¸Ì

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-6-1 20:28 ½s¿è

¦^´_ 4# jaga0828
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim AR(), i As Integer, ii As Integer, fs As String, Rng As Range
  4.     With ActiveSheet
  5.         .Cells = ""
  6.         .Pictures.Delete
  7.         fs = Dir("D:\test\*.jpg")
  8.         Do Until fs = ""
  9.             ReDim Preserve AR(0 To i)
  10.             AR(i) = fs  '¹Ï¤ù¦WºÙ¸m¤J°}¦C
  11.             fs = Dir
  12.             i = i + 1
  13.         Loop
  14.         For i = 0 To UBound(AR) Step 2
  15.             For ii = 0 To 1
  16.                 If ii + i <= UBound(AR) Then
  17.                     .Cells(Int(i / 2) + 1, 1 + (ii * 2)) = AR(ii + i)
  18.                     Set Rng = .Cells(Int(i / 2) + 1, 2 + (ii * 2))
  19.                     With .Pictures.Insert("D:\test\" & AR(ii + i))
  20.                         .Top = Rng.Top
  21.                         .Left = Rng.Left
  22.                         .Width = Rng.Width
  23.                         .Height = Rng.Height
  24.                 End With
  25.                 End If
  26.             Next
  27.         Next
  28.     End With
  29. End Sub
½Æ»s¥N½X
  1. Sub Ex_1()
  2.     Dim f As Object, E As Object, Rng As Range, i  As Integer
  3.     Set f = CreateObject("Scripting.FileSystemObject").getfolder("D:\test").Files
  4.     With ActiveSheet
  5.         .Cells = ""
  6.         .Pictures.Delete
  7.         i = 1
  8.         For Each E In f
  9.             If LCase(E) Like "*.jpg" Then
  10.                 If i Mod 2 > 0 Then
  11.                     Set Rng = .Cells(Int(i / 2) + 1, 1)
  12.                 Else
  13.                     Set Rng = .Cells(i - Int(i / 2), 3)
  14.                 End If
  15.                 Rng.Value = E
  16.                 With .Pictures.Insert(E)
  17.                     .Top = Rng.Cells(1, 2).Top
  18.                     .Left = Rng.Cells(1, 2).Left
  19.                     .Width = Rng.Cells(1, 2).Width
  20.                     .Height = Rng.Cells(1, 2).Height
  21.                 End With
  22.                 i = i + 1
  23.             End If
  24.         Next
  25.     End With
  26. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤ß¤¤±`¦sµ½¸Ñ¡B¥]®e¡B·P«ä¡Bª¾¨¬¡B±¤ºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD