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

½Ð°Ý¶}±ÒÂÂÀɦp¦ó·f°t°j°é¨Ï¥Î

½Ð°Ý¦p¦ó¦b¶}±ÒÂÂÀɪº¸ô®|¤¤¥[¤JÅܼƥH·f°t°j°é¨Ï¥Î

¦U¦ì¤j¤j¦n¡G
§Ú·Q½Ð°Ý¡G
                   ¦p¦ó¦b¶}±ÒÂÂÀɪº¸ô®|¤¤¥[¤JÅܼƥH·f°t°j°é¨Ï¥Î ¡H
§Úªºµ{¦¡¦p¤U¡G
Sub ¬Û¤¬¤ñ¸û§ä¥­§¡­È()
    Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\pkg_foam_pol_v01\[email protected]"
    Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\Pink_EPP_15_pol_v01\[email protected]"
    Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\[email protected]"
    Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\EPP_15_pol_02\[email protected]"
    Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\clutter\clutter [email protected]"
¦b¤W­±¸ô®|¤¤ªº ¡u0.6¡v´N¬O§Ú·Q¥[¤JÅܼƪº¦a¤è¡H
°ÝÃD ¡G 1.  for loop ¤¤ªº step ¥H 0.1 ÅܤƩO¡H
              2. ¦p¦ó¶}±Ò  ¥¨¶°¡H ¥Ø«e¬O¥Î¤â°Ê¤è¦¡«ü¨ì ¥¨¶° ¦s©ñ¸ô®|¡I
ÁÂÁ ¦U¦ì¤j¤j ªº¸Ñ´b

TOP

¦^´_ 1# xyzw7
¸Õ¸Õ¬Ý
  1. Sub Ex()
  2.     Dim MyPath As String, Fs As Object, xlFolder As Object, xlfile As Object
  3.     With Application.FileDialog(msoFileDialogFolderPicker) 'ÀÉ®×¹ï¸Ü¤è¶ô-> ­­©w¸ê®Æ§¨
  4.         .AllowMultiSelect = False                          '­­©w³æ¤@¿ï¾Ü
  5.         .Show                                              'Åã¥Ü ÀÉ®×¹ï¸Ü¤è¶ô
  6.         If .SelectedItems.Count = 0 Then Exit Sub          '¨S¿ï¾ÜÂ÷¶}µ{¦¡
  7.         MyPath = .SelectedItems(1)                         '©Ò¿ï¾Üªº¸ê®Æ§¨
  8.     End With
  9.     'FileSystemObject ª«¥ó  ´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨ú¡C
  10.     Set Fs = CreateObject("Scripting.FileSystemObject").GetFolder(MyPath) '¨ú±o«ü©w¸ô®|¤¤¤å¦r¥ó§¨¬Û¹ïÀ³¨ìªº Folder(¸ê®Æ§¨) ª«¥ó¡C
  11.     For Each xlFolder In Fs.subfolders  'Fs.subfolders  -> Fsªº¸ê®Æ§¨¶°¦Xª«¥ó
  12.         'Each xlFolder   ¨Ì§Ç³B¸Ì¨C¤@¤l¸ê®Æ§¨
  13.         For Each xlfile In xlFolder.Files   'xlFolder.Files ¨C¤@¤l¸ê®Æ§¨ªºÀɮ׶°¦Xª«¥ó
  14.             'Each xlfile  ¨Ì§Ç³B¸Ì¨C¤@¤l¸ê®Æ§¨ªºÀÉ®×
  15.               If xlfile.Name Like "*@0.#*.csv" Then Workbooks.Open xlfile.FullName
  16.               'xlfile.Name Like "*@0.#*.csv"  ÀɮצWºÙ¬Û¦üªº¤å¦r®æ¦¡
  17.               '* ¥Nªí ¹s­Ó¥H¤Wªº¦r¤¸ ,# ¥ô¤@­Ó¼Æ¦r(0-9)¡C
  18.         Next
  19.     Next
  20. End Sub
½Æ»s¥N½X

TOP

·PÁ¤j¤jªº¦^ÂСI¡I
1.§Ú·Q½Ð°Ý¤@¤U¦pªG§Ú¦³7­Ó¸ê®Æ§¨­n¶}±Ò¡A§Ú·Q§Q¥ÎÀɦW¤¤ªº¼Æ¦rªº§ïÅܨӶ}±Ò¤£¦PªºÀɮסA¤£ª¾¥i¦æ¶Ü¡H
¨Ò¦p¡G
Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\[email protected]"  =>¶}±Ò²Ä¤@­ÓÀÉ®×
Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\[email protected] "  =>¶}±Ò²Ä¤G­ÓÀÉ®×
Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\[email protected]"   => ¶}±Ò²Ä¤T­ÓÀÉ®×
2. ¦p¦ó¦bvba¤¤¥H¼gµ{¦¡¤è¦¡ ¶}±Ò¥¨¶° (¥Ø«e§Ú¬O¥Î¤â°Ê¤è¦¡¶}±Ò¥¨¶°)?

·PÁ¦U¦ì¤j¤j

TOP

¦A¸É¥R²Ä¤@­Ó°ÝÃD¡G¦]¬°§Ú­n¶}±ÒÂÂÀɫܦh¡A¤£ª¾¹D¥Î¦óºØ¡u°j°é¡v¨Ó¶}±ÒÀɤñ¸û¦n¡I

TOP

½Ð°Ý¶}±ÒÂÂÀɦp¦ó·f°t°j°é¨Ï¥Î

¦U¦ì¤j¤j¦n¡G
§Ú·Q½Ð°Ý¡G
                   1.§Ú·Q½Ð°Ý¤@¤U¦pªG§Ú¦³7­Ó¸ê®Æ§¨­n¶}±Ò¡A§Ú·Q§Q¥ÎÀɦW¤¤ªº¼Æ¦rªº§ïÅܨӶ}±Ò¤£¦PªºÀɮסA¤£ª¾¥i¦æ¶Ü¡H
¨Ò¦p¡G
Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\[email protected]"  =>¶}±Ò²Ä¤@­ÓÀÉ®×
Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\[email protected] "  =>¶}±Ò²Ä¤G­ÓÀÉ®×
Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\[email protected]"   => ¶}±Ò²Ä¤T­ÓÀÉ®×
¦]¬°§Ú­n¶}±ÒÂÂÀɫܦh¡A¤£ª¾¹D¥Î¦óºØ¡u°j°é¡v¨Ó¶}±ÒÀɤñ¸û¦n¡I¦]¬°§Ú­n¶}±ÒÂÂÀɫܦh¡A¤£ª¾¹D¥Î¦óºØ¡u°j°é¡v¨Ó¶}±ÒÀɤñ¸û¦n¡I

2. ¦p¦ó¦bvba¤¤¥H¼gµ{¦¡¤è¦¡ ¶}±Ò¥¨¶° (¥Ø«e§Ú¬O¥Î¤â°Ê¤è¦¡¶}±Ò¥¨¶°)?

·PÁ¦U¦ì¤j¤j

¥»©«³Ì«á¥Ñ play9091 ©ó 2011-7-21 19:17 ½s¿è

¤U­±¦³¤@¶K°ÝÃD¬O®t¤£¦hªº¡A¥i¥H¸Õ¸Õ¬Ý¡K¡K©Î³\¬O§Aªº»Ý¨D¡C

½Ð°Ý¶}±ÒÂÂÀɦp¦ó·f°t°j°é¨Ï¥Î

¦Ó§Ú­Ó¤H³o´X¤Ñ¼g¤F¤@­Ó¶W¯Å¥¨¤jªºVBA¡AI7+SSD¶]¤]­n¤@¤À¥b¤~¶]§¹¡C¸Ì­±¤]­n¼g¨ì¥Î°j°é¶}±ÒÂÂÀɳo­Ó³¡¤À§âÀÉ®×¥á¤W¨Ó¤j®a°Ñ¦Ò¤@¤U¡K¡K
§Úªº¤èªk¤ñ¸û²Â¡I§Ú¥ý§â¸ôÍߦb¤u§@ªí¸Ì­±¿é¤J¦n¡A¥Î°j°é¥h¨ú¥X¸ôÍß¡A¦A¶}±ÒÀɮסK¡K²³æ½d¨Ò¦p¤U¡K
  1. Sub name_test()
  2.     For I = 4 To 10
  3. '¥s¥XKPI³ø§i
  4.     KPI = Workbooks("¸ôÍߪ©").Sheets("¤u§@ªí3").Range("D" & I).Value
  5.     Workbooks.Open (KPI)
  6.     Set KPI = Nothing
  7.     KPI = ActiveWorkbook.name
  8.     Workbooks(KPI).Close SaveChanges:=True
  9.     Set KPI = Nothing
½Æ»s¥N½X
P.S.§Ú­Ó¤H¤ñ¸û·Qª¾¹Dªº¬O¦p¦ó¥ÎVBA¨ú¥XÀɮ׸ôÍß(¤£¶}±ÒÀɮתº±¡ªp¤U¡K¡K)¡A¦h°Ýªº¡K¡K

Åå¬ðµMµo²{°Ýªº¤H¬O¦P¤@­Ó¡I¡I¡I

¸ôÍߪ©.rar (18.48 KB)

ªì¾ÇVBA¥E¨ìtwbts

TOP

for i = 0.6 to 0.9 step 0.1
Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\OF_Form_pol_v01@" & i & "GHz.csv"

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-7-22 08:09 ½s¿è

¦^´_ 3# xyzw7
µ¹§Aªº¦^¤å: §A¤]¨S»¡¦ó¤£¦X¥Î , §A¬O¦³7­ÓÀÉ®× ÁÙ¬O7­Ó¸ê®Æ§¨³o¬O¤£¤@¼Ëªº
­n¦^¤å ½Ð«ö [¦^ÂÐ] «ö¶s  µªÂЧAªº¤H¤~·|±o¨ì³qª¾ ,ª¾¹D§A¦³µo¤å
§A­nªº¬O³o¼Ë¶Ü>
  1. Sub Ex()
  2.     Dim i As Integer
  3.     For i = 6 To 6 + 6
  4.         Workbooks.Open "D:\¤£¦P§÷®Æªºpattern¤ñ¸û 20110704\OF_Form_pol_v01\OF_Form_pol_v01@0." & i /10 & "GHz.csv" '>= ¶}±Ò²Ä¤@­ÓÀÉ®×
  5.     Next
  6. End Sub
½Æ»s¥N½X

TOP

¦^´_ 8# GBKEE

ÁÂÁ¤j¤j±Ð¾É¡I
§Ú¬O¦³¤C­Ó¸ê®Æ§¨¡A¨C­Ó¸ê®Æ§¨¤¤¦³¤@¦Ê­Ó¦h­ÓÀÉ®×­n¶}±Ò¡I

¦b½Ð°Ý¤j¤j¡G
                         ¦p¦ó¦bvba¤¤¥H¼gµ{¦¡¤è¦¡ ¶}±Ò¥¨¶° (¥Ø«e§Ú¬O¥Î¤â°Ê¤è¦¡¶}±Ò¥¨¶°)?

·PÁ¤j¤jªº¦^ÂÐ

TOP

¦^´_ 7# oobird


    ½Ð°Ý¤j¤j¡G

                       §A³o¼Ë¤lÅܼƭn¦p¦ó³]©w©O¡H§Ú¦³¸Õ¹L§A³o¼Ë¤lªº¤è¦¡¡A¥i¬O¦bstep«á­±ªº¼Æ¦r·|Åܦ¨  ####
½Ð°Ý¦p¦ó¨M¸Ñ©O¡H

TOP

        ÀR«ä¦Û¦b : ¡i°±º¢¤£«e¡A²×µL©Ò±o¡j¤H³£°g©ó´M§ä©_ÂÝ¡A¦]¦Ó°±º¢¤£«e¡FÁa¨Ï®É¶¡¦A¦h¡B¸ô¦Aªø¡A¤]¤FµL¥Î³B¡A²×µL©Ò±o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD