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

[µo°Ý] ¦p¦ó§Q¥Î°j°é©Î¨ä¥L¤è¦¡¿ï¨ú¤é´Á½d³ò¦Û°Ê¿é¤Jinputbox

[µo°Ý] ¦p¦ó§Q¥Î°j°é©Î¨ä¥L¤è¦¡¿ï¨ú¤é´Á½d³ò¦Û°Ê¿é¤Jinputbox

½Ð°Ý¦p¦ó§Q¥Î°j°é©Î¨ä¥L¤è¦¡¿ï¨ú¤@¤é´Á½d³ò¦Û°Ê¿é¤Jinputbox¹ï¸Ü¤è¶ô¤º
¦]¬°¤â°Ê¿é¤J¤é´Á¤Ó¦h
ÁÂÁÂ
§Ú·Q­n¨ú±o¤T¤jªk¤Hª÷ÃB²Î­p(ÃÒ¥æ©Ò)

saveCSVfmURL(1).rar (12.05 KB)

saveCSVfmURL(1).rar (12.05 KB)

¦^´_ 15# ten999
°Ñ¦Ò Hsieh ±Ð¾Ç  ÀÉ®×¾Þ§@½d¨Ò (Dir / Filesystem Object  Dir ¶i¶¥À³¥Î½d¨Ò¦C¥X«ü©w¥Ø¿ý¤§¤U©Ò¦³ªº¤l¸ê®Æ§¨¤º®e)
±N¼Æ­Ó¸ê®Æ§¨(2004\04\200404total.xls -- 2004\05\200405total.xls--2005\01\200501total.xls----¤U¼Æ­Ó¯S©wÀÉ®×(*\*\*total.xls)¦Cªí©ósheet1¤º!

½Ð°Ý¦p¦ó¨Ì§Ç¶}±Ò³o¨ÇÀÉ®×(*total.xls)±N©T©wªºµ{¦¡½X(ªþ¥ó¤º¼Ò²Õ:module3)¼g¤J³o¨ÇÀɮפº°õ¦æ¯S©w¤u§@«áÃö³¬!
ÁÂÁÂ!

saveCSVfmURL(1).rar (25.27 KB)

TOP

§Q¥Î¤U¦Cvba±N¼Æ¤d­ÓcsvÀÉ(¦P¤@¸ê®Æ§¨¤º)¨Ì¦~«×¤ë¥÷«Ø¥ß¸ê®Æ§¨
·Q½Ð°Ýµ{¦¡½X¤¤#6¦CA = Mid(F, InStr(F, "2004"))  ¤¤2004¬°¤â°Ê¿é¤J(µ{¦¡½X½s¿èµøµ¡/°»¿ù/³v¦æ) ,¬O§_¦³¨ä¥L¤è¦¡¥i§ïµ½!
ÁÂÁ         
Sub Ex()  
    Dim fs As Object, F As Object, A$, MyPath$
    MyPath = ThisWorkbook.Path                           
   Set fs = CreateObject("Scripting.FileSystemObject")   
    For Each F In fs.GetFolder(MyPath).Files
        If InStr(F, ".csv") Then   
            A = Mid(F, InStr(F, "2004"))            
            'A = Replace(A, ".csv", "")               
           ' A = Replace(A, "-", "\")               
            If fs.FolderExists(MyPath & "\" & Mid(A, 1, 4)) = False Then
             ChDir MyPath                        
            MkDir MyPath & "\" & Mid(A, 1, 4)              
            End If
            If fs.FolderExists(MyPath & "\" & Mid(A, 1, 4) & "\" & Mid(A, 5, 2)) = False Then                      ChDir MyPath & "\" & Mid(A, 1, 4)
                MkDir MyPath & "\" & Mid(A, 1, 4) & "\" & Mid(A, 5, 2)
            End If
            'If fs.FolderExists(MyPath & "\" & A) = False Then   
                'ChDir MyPath & "\" & Mid(A, 1, 7)
               ' MkDir MyPath & "\" & A
            'End If
            fs.moveFile F, MyPath & "\" & Mid(A, 1, 4) & "\" & Mid(A, 5, 2) & "\"  
        End If
    Next
    ChDir MyPath                                   
End Sub

TOP

¦^´_ 13# Hsieh


ÁÂÁ Hsieh ¤ÎGBKEE¨â¦ì±Ð¾É !
½Ð±Ð¦p¦ó±N¤@­Ó¸ê®Æ§¨¤º«Ü¦hµ§ªºcsvÀÉ(¦WºÙ¬°¤é´Á¼Ë¦¡ 20110103ms.csv  20110104ms.csv-------)¨Ì ¦~«× ¤ë¥÷ ²Ä´X©P¤Àªù§OÃþ
¨Ò¦p c:/test/2011/01/²Ä¤@©P,c:/test/2011/01/²Ä¤G©P --- c:/test/2011/02/²Ä¤@©P c:/test/2011/02/²Ä¤G©P-----
¦]¬°»Ý­nÆ[¹îªøµu´Á¦¨¥æ¶qª÷ÃB
ÁÂÁÂ

TOP

¦^´_ 11# ten999
¤W¯Z¤é¡B¥ð°²¤é¦b¥xÆW¹ê¦æªº¬O¦³ÂI¶Ã
¦ý¬O¡A´Nµ{¦¡³]­p¦Ó¨¥¡A·íµL³W«h¥i´`®É´N¥Î¦Cªí¸Ñ¨M
¨º»ò¦Cªíªº®æ¦¡´N§ñÃö«°¥«¹B¦æ¬O§_¶¶ºZ
¤£³W«hªº±ø¥ó­n¥Î¦Cªíªº·N¸q¦b©ó®e©ö§ä¥X³W«h
¦ý§Aªº³]­p¤Ï¦ÓÅý¦Cªí½ÆÂø¡A«Øij¥u¥Î2Äæ¦ì¨Ó°O¿ý°²¤é
  1. Sub testCr()
  2. Dim selDate As Date, °_©l¤é´Á As Date, µ²§ô¤é´Á As Date
  3. °_©l¤é´Á = InputBox("¿é¤J°_©l¤é´Á", , 2001 / 12 / 29)
  4. µ²§ô¤é´Á = InputBox("¿é¤J µ²§ô¤é´Á", , Date)
  5. For selDate = °_©l¤é´Á To µ²§ô¤é´Á
  6. If IsError(Application.Match(CDbl(selDate), Sheets("¥æ©ö²§°Êªí").[A:A], 0)) Then
  7.    If Weekday(selDate, 2) < 6 Or IsNumeric(Application.Match(selDate, Sheets("¥æ©ö²§°Êªí").[B:B], 0)) Then
  8.       saveCSVfmURL selDate
  9.    End If
  10. End If
  11. Next
  12. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 11# ten999
¸Õ¸Õ¬Ý
  1. Sub testCr()
  2.     Dim selDate As Date, °_©l¤é´Á As Date, µ²§ô¤é´Á As Date
  3.     Dim Rng As Range
  4.     On Error Resume Next    'ªí¥Ü·í¤@­Ó°õ¦æ¶¥¬q¿ù»~²£¥Í®É¡Aµ{¦¡±±¨î¥ß¨è¨ìµo¥Í¿ù»~³¯­z¦¡±µ¤U¥hªº³¯­z¦¡¡A¦ÓÄ~Äò°õ¦æ¤U¥h
  5.     °_©l¤é´Á = InputBox("¿é¤J°_©l¤é´Á")
  6.     If °_©l¤é´Á = False Then Exit Sub
  7.     µ²§ô¤é´Á = InputBox("¿é¤J µ²§ô¤é´Á")
  8.     If µ²§ô¤é´Á = False Then Exit Sub
  9.     On Error GoTo 0             '°±¤î²{¦bµ{§ÇùØ¥ô¦ó¤w±Ò°Êªº¿ù»~³B²zµ{¦¡
  10.     For selDate = °_©l¤é´Á To µ²§ô¤é´Á
  11.         Set Rng = Sheets("«D¥æ©ö¤é").Cells.Find(selDate, LookIn:=xlValues)  '¦b«D¥æ©ö¤é¤¤´M§ä¤é´Á
  12.         If Rng Is Nothing Then                                              '«D¥æ©ö¤é¤¤§ä¤£¨ì¤é´Á
  13.             Select Case Weekday(selDate)
  14.                 Case 2 To 6                                                 '¶g¤@¨ì¶g¤­
  15.                     saveCSVfmURL selDate
  16.                 Case Else    '-> Case 1 , 7                                 '°²¤é
  17.                     Set Rng = Sheets("¸É¥æ©ö¤é").Cells.Find(selDate, LookIn:=xlValues)     '°²¤é¤¤´M§ä¸É¥æ©ö¤é¤é´Á
  18.                     If Not Rng Is Nothing Then saveCSVfmURL selDate         '§ä¨ì¤é´Á
  19.             End Select
  20.         End If
  21.     Next
  22. End Sub
½Æ»s¥N½X

TOP

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

¦^´_ 10# Hsieh

ÁÂÁÂHsieh¦^´_¤Î±Ð¾ÇÅý§Ú¸Ñ¨M°ÝÃD.
½Ð°Ý¥t¥~«ä¦Ò¤è¦¡:¬O§_¥i§Q¥Î«Ø¥ßsheet¤u§@ªí¤è¦¡(°Ñ¦ÒÃÒ¥æ©Ò¤º¦³¦~«×¥ð¥«¤é´Á)±N¦U¦~«×(¦p:2002-2011¦~)¯S©w°²¤é»s§@ªí®æÅýµ{¦¡°õ¦æ¹Lµ{¥i¥ý§PÂ_¨äªí®æ¤º½d³ò­È¬O§_¬Û¦P¦A°õ¦æ.(¦]¬°¦~«×°²¤é¤¤¦³³¡¤À¼u©Ê¥ð°²¤Î¸É¥æ©ö¤é¦]¯À,¦P®É¹³ºÝ¤È ¤¤¬î ¹A¾ä¬K¸`¦U¦~«×¤é´Á¨Ã¤£¦P)
ÁÂÁÂ
¤é´Áªí®æ¦pªþ¥ó(«D¥æ©ö¤é¤£¶}½L ¸É¥æ©ö¤é(¸g±`¬O§Q¥Î¬P´Á¤»)
saveCSVfmURL(1).rar (14.61 KB)

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-7-19 14:12 ½s¿è

¦^´_ 9# ten999

«Øij¨Ï¥Î°²´Áªí¦C¤è¦¡
§PÂ_°j°é¤¤ÅÜ¼Æ ¬O§_¬°°²´Áªí¤º¤é´Á
  1. Sub testCr()
  2. Dim selDate As Date, °_©l¤é´Á As Date, µ²§ô¤é´Á As Date, °²´Á
  3. °²´Á = Array("01/01", "02/28", "04/05", "10/10")
  4. °_©l¤é´Á = InputBox("¿é¤J°_©l¤é´Á")
  5. µ²§ô¤é´Á = InputBox("¿é¤J µ²§ô¤é´Á")
  6. For selDate = °_©l¤é´Á To µ²§ô¤é´Á
  7. If Weekday(selDate, 2) <= 5 And IsError(Application.Match(Format(selDate, "mm/dd"), °²´Á, 0)) Then saveCSVfmURL selDate
  8. Next
  9. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¸É¥R»¡©ú:
¤W¦Cµ{¦¡¥i§_¨ä¥L¤è¦¡Â²¤Æ
¤Î¦p¦ó¨ú±o¯S©w°²¤é(¦p:¤¸¥¹ 228 ......)
ÁÂÁÂ!

TOP

¦Ò¼{¬P´Á¤» ¬P´Á¤é §Q¥Îweekday¨ç¼Æ¨ú±o¬P´Á¤»¤é
    Sub testCr()
Dim selDate As Date, °_©l¤é´Á As Date, µ²§ô¤é´Á As Date
°_©l¤é´Á = InputBox("¿é¤J°_©l¤é´Á")
µ²§ô¤é´Á = InputBox("¿é¤J µ²§ô¤é´Á")
For selDate = °_©l¤é´Á To µ²§ô¤é´Á
If Weekday(selDate) = 1 Then
Debug.Print selDate
ElseIf Weekday(selDate) = 7 Then
Debug.Print selDate
ElseIf Weekday(selDate) = 2 Then
saveCSVfmURL selDate
ElseIf Weekday(selDate) = 3 Then
saveCSVfmURL selDate
ElseIf Weekday(selDate) = 4 Then
saveCSVfmURL selDate

ElseIf Weekday(selDate) = 5 Then
saveCSVfmURL selDate

ElseIf Weekday(selDate) = 6 Then
saveCSVfmURL selDate
End If
Next
End Sub

TOP

        ÀR«ä¦Û¦b : «Ý¤H°h¤@¨B¡A·R¤H¼e¤@¤o¡A´N·|¬¡±o«Ü§Ö¼Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD