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

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

¥»©«³Ì«á¥Ñ 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

¦^´_ 21# GBKEE
  1. Option Explicit

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

¨Ñ°µ´ú¸Õ¥Î¡G   ´¡¤J¹Ï¤ù2.rar (9.79 KB)

TOP

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

TOP

¦^´_ 19# GBKEE
³o¦¸¥i¥HÅã¥Ü¥X¹Ï¤ù¤F
·PÁÂGBKEE¤j¤jªºÀ°§U

TOP

¦^´_  c_c_lai
2003ª© ¨S¦³¿ù»~!!
¿ù»~ÂI «e  Debug.Print f   ¬Ý¬Ý: ¬O­þ­Ó¹ÏÀÉ,±N¥L§R±¼¸Õ¸Õ
GBKEE µoªí©ó 2012-12-13 12:09

´ú¥XÄpµ²¤F¡A°ÝÃD¥X¦b f  ÅܼƤ§¨Ï¥Î¤W¡G
  1.         With ActiveSheet.Pictures.Insert(f)
½Æ»s¥N½X
·|¥X²{ 1004 ªº¿ù»~°T®§¡A»Ý­×¥¿¬°¡G
  1.         With ActiveSheet.Pictures.Insert(e & "\" & f.Name)
½Æ»s¥N½X
¦p¦¹¬Ý¨Ó¡AFor Each f In e.Files  ªº f ¦b 2003 ¥¦¥i¥H·í¦¨¦r¦êª½±µ³B²z¡A
¦Ó¦b 2010 ®É¡A  f «hµø¬°¤@­Óª«¥ó (Class)¡A¦¹®É¦pªGª½±µ¨Ï¥Î¥¦°õ¦æ
With ActiveSheet.Pictures.Insert(f) ´N·|¥X²{ 1004 ªº¿ù»~°T®§¡C

TOP

¦^´_ 25# c_c_lai
ÁÂÁÂ:¤W¤F¤@½Ò

TOP

¦^´_ 26# GBKEE
¦A°Ý¤@­Ó°ÝÃD....
®É¶¡ÂIªº°ÝÃD¤w¸Ñ¨M
¦ý¬O¤S¹J¨ì¤@­Ó°ÝÃD¤F
¥Ø«eªº¥¨¶°¥u¯à§ì¨ì«ü©w®É¶¡ÂI¤U­±ªº¹Ï¤ù
¦pªG¸Ì­±ÁÙ¦³¤l¸ê®Æ§¨
¨º«ç»ò¿ì©O

TOP

¦^´_ 25# c_c_lai
Dim  f As Variant   ³o¼Ë¸Õ¸Õ, 2007ÁÙ¦³¿ù»~¶Ü?     

¦^´_ 27# whirlwind963
  1. Option Explicit
  2. Dim i As Integer, xCol As Integer
  3. Sub Ex()
  4.     Dim fs, f As Object, e As Object
  5.     Sheets(1).Activate
  6.     ActiveSheet.Pictures.Delete
  7.     Set fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\2012-12-12")
  8.     xCol = 3    'Äæ¼Æ
  9.     For Each e In fs.subfolders     '¸ê®Æ§¨¶°¦Xª«¥ó
  10.         i = 1                       '¦C¼Æ
  11.         ¤l¸ê®Æ§¨ e
  12.         xCol = xCol + 1             'Äæ¼Æ
  13.     Next
  14. End Sub
  15. Private Sub ¤l¸ê®Æ§¨(¸ê®Æ§¨ As Variant)
  16.     Dim fs  As Object, f As Variant
  17.     Set fs = CreateObject("Scripting.FileSystemObject").GetFolder(¸ê®Æ§¨)
  18.     For Each f In fs.Files    'ÀÉ®×:¶°¦Xª«¥ó
  19.         If UCase(f) Like "*.JPG" Or UCase(f) Like "*.GIF" Or UCase(f) Like "*.BMP" Then
  20.             i = i + 1
  21.             With ActiveSheet.Pictures.Insert(f)
  22.                 .Top = Cells(i, xCol).Top
  23.                 .Left = Cells(i, xCol).Left
  24.                 .Height = 49.5
  25.                 .Width = 49.5
  26.                 Cells(i, xCol).RowHeight = .Height
  27.                 Cells(i, xCol).ColumnWidth = .Width / 5.5
  28.             End With
  29.         End If
  30.     Next
  31.     For Each f In fs.subfolders     '¸ê®Æ§¨:¶°¦Xª«¥ó
  32.         i = i + 1
  33.         ¤l¸ê®Æ§¨ f                  '¦A«×©I¥s (¥»µ{§Ç)
  34.     Next
  35. End Sub
½Æ»s¥N½X

TOP

¦^´_ 28# GBKEE
§Ú¬ÝÀ´¤F~
·PÁÂ~
¸ò4#ªºµ{¦¡½X®t¤F¤@ÂI
Private Sub ¤l¸ê®Æ§¨(TheFolder)
    Dim fs As Object, f As Object
    Set fs = CreateObject("Scripting.FileSystemObject").GetFolder(TheFolder)
=========================================================
    Private Sub ¤l¸ê®Æ§¨(¸ê®Æ§¨ As Variant)
        Dim fs  As Object, f As Variant
        Set fs = CreateObject("Scripting.FileSystemObject").GetFolder(¸ê®Æ§¨)
¥i¥H½Ð°Ý¤W­±¸ò¤U­±ªº®t§O¶Ü

TOP

¦^´_ 29# whirlwind963
¬O¤@¼Ëªº: ³o¤Þ¼Æ TheFolder ¨S«Å§i«¬ºA ´N¬O  As Variant
  1. Variant ¸ê®Æ«¬ºA
  2. Variant ¸ê®Æ«¬ºA¬O©Ò¦³¨S³Q©ú½T«Å§i¬°¨ä¥L«¬
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD