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

[µo°Ý] ¦p¦ó ´¡¤J ¸ê®Æ§¨¤¤§t¤l¸ê®Æ§¨ªº ¹Ï¤ù

¦^´_ 1# oxrain
¸Õ¸Õ¬Ý
  1. Dim i As Integer
  2. Sub Ex()
  3.     Dim fs, f, e As Variant
  4.     Sheets(1).Activate
  5.     ActiveSheet.Pictures.Delete
  6.     i = 1
  7.     For Each e In Array("D:\PIC0", "D:\PIC01")
  8.         Set fs = CreateObject("Scripting.FileSystemObject").GetFolder(e)
  9.         ¤l¸ê®Æ§¨ fs
  10.     Next
  11. End Sub
  12. Private Sub ¤l¸ê®Æ§¨(TheFolder)
  13.     Dim fs As Object, f As Object
  14.     Set fs = CreateObject("Scripting.FileSystemObject").GetFolder(TheFolder)
  15.     For Each f In fs.Files
  16.         If UCase(Mid(f, InStr(f, ".") + 1)) = "JPG" Then
  17.              With ActiveSheet.Pictures.Insert(f)
  18.                 .Top = Cells(i, "A").Top
  19.                 .Height = 49.5
  20.                 .ShapeRange.LockAspectRatio = msoTrue
  21.                 .ShapeRange.IncrementLeft 0.75
  22.             End With
  23.             i = i + 5
  24.        End If
  25.     Next
  26.     For Each f In fs.SubFolders
  27.          ¤l¸ê®Æ§¨ f
  28.     Next
  29. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# whirlwind963
  1. Dim i As Integer, xCol As Integer
  2. Sub Ex()
  3.     Dim fs, f, e As Variant
  4.     Sheets(1).Activate
  5.     ActiveSheet.Pictures.Delete
  6.     'C2¶}©l
  7.     i = 2       '¦C¼Æ
  8.     xCol = 3    'Äæ¼Æ
  9.     For Each e In Array("D:\¬Û¤ù")
  10.         Set fs = CreateObject("Scripting.FileSystemObject").GetFolder(e)
  11.         ¤l¸ê®Æ§¨ fs
  12.     Next
  13. End Sub
  14. Private Sub ¤l¸ê®Æ§¨(TheFolder)
  15.     Dim fs As Object, f As Object
  16.     Set fs = CreateObject("Scripting.FileSystemObject").GetFolder(TheFolder)
  17.     For Each f In fs.Files
  18.         If UCase(Mid(f, InStr(f, ".") + 1)) = "JPG" Then
  19.              With ActiveSheet.Pictures.Insert(f)
  20.                 '.Top = Cells(i, "A").Top
  21.                  .Top = Cells(i, xCol).Top
  22.                  .Left = Cells(i, xCol).Left
  23.                 .Height = 49.5
  24.                 .Width = 49.5
  25.                 .ShapeRange.LockAspectRatio = msoTrue
  26.                 .ShapeRange.IncrementLeft 0.75
  27.             End With
  28.             i = i + 5
  29.               If i >= 5 * 10 Then  '10­Ó¹Ï´N´«¤@Äæ
  30.                 xCol = xCol + 1
  31.                 i = 2
  32.             End If
  33.        End If
  34.     Next
  35.     For Each f In fs.SubFolders
  36.          ¤l¸ê®Æ§¨ f
  37.     Next
  38. End Sub
½Æ»s¥N½X

TOP

¦^´_ 7# whirlwind963
5# °Ý :  CÄæÅã¥Ü¹Ï¤ùDÄæÅã¥Ü¹Ï¤ùªº¦WºÙ  §A¤w¦b6# ¦Û¦æ¸Ñµª,

6# °Ý : ¨ú±oÀɮצWºÙ(f.Name),¤£­n§¹¾ãªº¸ô®| f

7# °Ý : Àˬd  NN= cells(2,1),MM=cells(3,1)  ªº¸ô®|¹ï¶Ü?
¦³¿ìªk¦Û¤v¦bÀx¦s®æ¿é¤J¦ì§}¶Ü? ¤£À´§Aªº·N«ä.

TOP

¦^´_ 9# whirlwind963
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim fs, f, e As Variant, i As Integer, xCol As Integer
  4.     Sheets(1).Activate
  5.     ActiveSheet.Pictures.Delete
  6.     xCol = 3    'Äæ¼Æ
  7.     Set fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\¬Û¤ù")
  8.     For Each e In fs.subfolders  '¸ê®Æ§¨¶°¦Xª«¥ó
  9.         i = 2       '¦C¼Æ
  10.         Cells(i, xCol) = e.Name
  11.         For Each f In e.Files    'ÀÉ®×¶°¦Xª«¥ó
  12.             If UCase(Mid(f, InStr(f, ".") + 1)) = "JPG" Then
  13.                 i = i + 1
  14.                 With ActiveSheet.Pictures.Insert(f)
  15.                     .Top = Cells(i, xCol).Top
  16.                     .Left = Cells(i, xCol).Left
  17.                     .Height = 49.5
  18.                     .Width = 49.5
  19.                     Cells(i, xCol).RowHeight = .Height
  20.                     Cells(i, xCol).ColumnWidth = .Width / 5.5
  21.                     End With
  22.             End If
  23.         Next
  24.         xCol = xCol + 1   'Äæ¼Æ
  25.     Next
  26. End Sub
½Æ»s¥N½X

TOP

¦^´_ 11# whirlwind963
  1. Option Explicit
  2. Sub Ex()
  3.     Dim fs, f, e As Variant, i As Integer, xCol As Integer
  4.     Sheets(1).Activate
  5.     ActiveSheet.Pictures.Delete
  6.     xCol = 3    'Äæ¼Æ
  7.     Set fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\2012-12-12")
  8.     '**ÀÉ®×,¸ê®Æ§¨ªº©R¦W¤¤: ¤£¥i¦³  / \ : * ? < > |  ³o¨Ç¦r¤¸
  9.     For Each e In fs.subfolders  '¸ê®Æ§¨¶°¦Xª«¥ó
  10.         i = 2       '¦C¼Æ
  11.         If e.Name >= [A1] And e.Name <= Range("B1") Then '¦pªG§Ú¦bA1¿é¤J06  B1¿é¤J12
  12.         'If e.Name >= 5 And e.Name <= 10 Then            '5 ¨ì 10
  13.             For Each f In e.Files    'ÀÉ®×¶°¦Xª«¥ó
  14.                 i = i + 1
  15.                 With ActiveSheet.Pictures.Insert(f)
  16.                     .Top = Cells(i, xCol).Top
  17.                     .Left = Cells(i, xCol).Left
  18.                     .Height = 49.5
  19.                     .Width = 49.5
  20.                     Cells(i, xCol).RowHeight = .Height
  21.                     Cells(i, xCol).ColumnWidth = .Width / 5.5
  22.                 End With
  23.             Next
  24.             xCol = xCol + 1   'Äæ¼Æ
  25.         End If
  26.     Next
  27. End Sub
½Æ»s¥N½X

TOP

¦^´_ 13# whirlwind963
³o¸Ì¦³§ï¶Ü?
  1. Set fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\2012-12-12")
  2.                       '**ÀÉ®×,¸ê®Æ§¨ªº©R¦W¤¤: ¤£¥i¦³  / \ : * ? < > |  ³o¨Ç¦r¤¸
½Æ»s¥N½X

TOP

¦^´_ 16# whirlwind963
¤W¶Ç:ÀÉ®×,¸ê®Æ§¨ ¬Ý¬Ý

TOP

¦^´_ 18# whirlwind963
  1. Option Explicit
  2.     Sub Ex()
  3.         Dim fs, f, e As Variant, i As Integer, xCol As Integer
  4.         Sheets(1).Activate
  5.         ActiveSheet.Pictures.Delete
  6.         xCol = 3    'Äæ¼Æ
  7.         Set fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\2012-12-12")
  8.         '**ÀÉ®×,¸ê®Æ§¨ªº©R¦W¤¤: ¤£¥i¦³  / \ : * ? < > |  ³o¨Ç¦r¤¸
  9.         For Each e In fs.subfolders  '¸ê®Æ§¨¶°¦Xª«¥ó
  10.             i = 2       '¦C¼Æ
  11.             If Val(e.Name) >= [A1] And Val(e.Name) <= Range("B1") Then '¦pªG§Ú¦bA1¿é¤J06  B1¿é¤J12
  12.             'If e.Name >= 5 And e.Name <= 15 Then            '5 ¨ì 10
  13.                 For Each f In e.Files    'ÀÉ®×¶°¦Xª«¥ó
  14.                     If UCase(f) Like "*.JPG" Or UCase(f) Like "*.GIF" Or UCase(f) Like "*.BMP" Then
  15.                     '¹w¨¾¤£¬O¹Ï¤ùÀÉ
  16.                     i = i + 1
  17.                     With ActiveSheet.Pictures.Insert(f)
  18.                         .Top = Cells(i, xCol).Top
  19.                         .Left = Cells(i, xCol).Left
  20.                         .Height = 49.5
  21.                         .Width = 49.5
  22.                         Cells(i, xCol).RowHeight = .Height
  23.                         Cells(i, xCol).ColumnWidth = .Width / 5.5
  24.                     End With
  25.                     End If
  26.                 Next
  27.                 xCol = xCol + 1   'Äæ¼Æ
  28.             End If
  29.         Next
  30.     End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-12-13 11:15 ½s¿è

¦^´_ 20# c_c_lai
µ{§Ç¤¤¥Î On Error Resume Next  ¦³®É·|§ä¤£¥X¿ù»~ÂIªº
¬Ý¤@¤U  19#
  1.    
  2.            ' MyFile = Dir(e & "\*" & Cells(j, "C") & "*.*")  §ï¥Î¤F   
  3.           If UCase(f) Like "*.JPG" Or UCase(f) Like "*.GIF" Or UCase(f) Like "*.BMP" Then
  4.                     '¹w¨¾¤£¬O¹Ï¤ùÀÉ
½Æ»s¥N½X

TOP

¦^´_ 22# c_c_lai
2003ª© ¨S¦³¿ù»~!!
¿ù»~ÂI «e  Debug.Print f   ¬Ý¬Ý: ¬O­þ­Ó¹ÏÀÉ,±N¥L§R±¼¸Õ¸Õ

TOP

        ÀR«ä¦Û¦b : ¤£©È¨Æ¦h¡A¥u©È¦h¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD