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

[µo°Ý] ½Ð±Ð¤@¤U¦¹¥y¥¨¶°¿ù»~¦p¦ó§ï?

[µo°Ý] ½Ð±Ð¤@¤U¦¹¥y¥¨¶°¿ù»~¦p¦ó§ï?

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-4-7 14:34 ½s¿è

Sub Ma3333()
Dim a As String
set a=v:\program\supertsc" & "\" & Format(Date, "eemmdd)
Workbooks.Open Filename:="a - 5 & ".xls"
"a - 5 & ".xls".Activate

End Sub
¥t¥~¤@­Ó°ÝÃD
Sub Macro2()
for k=1 to 15
On Error Resume Next
Workbooks.Open Filename:="v:\program\supertsc" & "\" & Format(Date, "eemmdd")-k & ".xls"
  next
123:
End Sub
1.°²¦p¶}ªºÀɮצs¦b«h¸õ¨ì123ªº»yªk¬O???
2¥u¯à¶}¨ì 1030401 , ±µ¤U¬O 1030399  ¤£¬O 1030331??

¦^´_ 1# t8899
  1. Option Explicit
  2. Sub Ma3333()
  3.     Dim A As Workbook
  4.     Set A = Workbooks.Open("v:\program\supertsc\" & Format(Date, "eemmdd"))
  5.     Workbooks.Open Filename:="a - 5.xls"
  6.     'Workbooks.Open Filename:="a - 5" & ".xls"  '©Î¬O
  7.     Workbooks("a - 5" & ".xls").Activate
  8.     'Workbooks("a - 5.xls").Activate            '©Î¬O
  9. End Sub
  10. Sub Macro2()  '1.°²¦p¶}ªºÀɮצs¦b«h¸õ¨ì123ªº»yªk¬O???
  11.     '2¥u¯à¶}¨ì 1030401 , ±µ¤U¬O 1030399  ¤£¬O 1030331  ****¬Ý¤£À´???
  12.     Dim k As Integer, A As String
  13.     For k = 1 To 15
  14.     A = "v:\program\supertsc" & "\" & Format(Date, "eemmdd") - k & ".xls"  '§¹¾ãªº¸ô®|ÀɮצWºÙ
  15.     If Dir(A) <> "" Then   'Àɮצs¦b«h Dir(A)¶Ç¦^ ÀɮצWºÙ
  16.         Workbooks.Open A
  17.         Exit For   'Â÷¶}¦^°é
  18.         ' GoTo 123 '©Î¬O ¨ì 123
  19.     End If
  20.   Next
  21. 123:
  22. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

GBKEE µoªí©ó 2014-4-7 15:58
2¥u¯à¶}¨ì 1030401 , ±µ¤U¬O 1030399  ¤£¬O 1030331  ****¬Ý¤£À´???

·íK=8 ¶Ç¦^¬O v:\program\supertsc\1030399.xls
¤£¬O v:\program\supertsc\1030331.xls ??

TOP

¦^´_  t8899
GBKEE µoªí©ó 2014-4-7 15:58


Set A = Workbooks.Open("v:\program\supertsc\" & Format(Date, "eemmdd")) ¦¹¦æ°õ¦æ§¹´N·|¶}±ÒÀÉ®×1030407.XLS
¾É­P¤U¤@¦æ Workbooks.Open Filename:="a - 5.xls"
¥X°ÝÃD==>"À³¥Îµ{¦¡©Îª«¥ó©w¸q¿ù»~??

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-4-7 20:40 ½s¿è
¦^´_  t8899
GBKEE µoªí©ó 2014-4-7 15:58
A = "v:\program\supertsc" & "\" & Format(Date, "eemmdd") - k & ".xls"  '§¹¾ãªº¸ô®|ÀɮצWºÙ
    If Dir(A) <> "" Then

ÀɮצWºÙªº«á­±¦³¦h¾lªº¤]¥[¤J²Å¦X±ø¥óªº§PÂ_¡A­n«ç»ò§ï?
¤S­n¦p¦ó¶}±Ò¥¿½TªºÀɮצWºÙ?
1030407.xls
1030407adef.xls
1030407bf.xls

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-4-7 20:53 ½s¿è

¦^´_ 4# t8899
  1. Format(Date - k, "eemmdd")
½Æ»s¥N½X
·í«eªº©Ò¦b¥Ø¿ý¨S¦³³oÀÉ®×,·|¦³À³¥Îµ{¦¡©Îª«¥ó©w¸q¿ù»~
  1. MsgBox CurDir  '·í«eªº©Ò¦b¥Ø¿ý
  2. Workbooks.Open Filename:="a - 5.xls"
  3. 'Workbooks.Open Filename:="§¹¾ã¸ô®|ÀɮצWºÙ.xls"
½Æ»s¥N½X
ÀɮצWºÙªº«á­±¦³¦h¾lªº¤]¥[¤J²Å¦X±ø¥óªº§PÂ_¡A­n«ç»ò§ï?
  1. Option Explicit
  2. Sub Ex()
  3.     Dim k
  4.     k = "1030407.xls"
  5.     If k Like "#######.xls" Then MsgBox k   '# ->¼Æ¦r
  6.     k = "1030407.xls"
  7.     If k Like "######.xls" Then MsgBox k    '? ->¦r¤¸
  8.     k = "1030407 adef.xls"
  9.     If k Like "####### ????.xls" Then MsgBox k
  10.     k = "1030407 adef.xls"
  11.     If k Like "####### ???.xls" Then MsgBox k
  12.     k = "1030407 bf.xls"
  13.     If k Like "####### ??.xls" Then MsgBox k
  14.     k = "1030407 bf.xls"
  15.     If k Like "####### ???.xls" Then MsgBox k
  16. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899 ·í«eªº©Ò¦b¥Ø¿ý¨S¦³³oÀÉ®×,·|¦³À³¥Îµ{¦¡©Îª«¥ó©w¸q¿ù»~
GBKEE µoªí©ó 2014-4-7 20:33

¬°¦óset «ü¥O´N·|°õ¦æ¶}±Òªº°Ê§@?(ÁÙ¨S¯u¥¿°õ¦æopen)

TOP

¦^´_ 7# t8899
Set ->«ü©wÅܼƬ°ª«¥ó
  1. Set A = Workbooks.Open("v:\program\supertsc\" & Format(Date, "eemmdd"))
½Æ»s¥N½X
Workbooks.Open ¬O¶}±ÒÀɮתº«ü¥O
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-4-8 06:51 ½s¿è
¦^´_  t8899 ·í«eªº©Ò¦b¥Ø¿ý¨S¦³³oÀÉ®×,·|¦³À³¥Îµ{¦¡©Îª«¥ó©w¸q¿ù»~ÀɮצWºÙªº«á­±¦³¦h¾lªº¤]¥[¤J²Å¦X±ø¥óªº ...
GBKEE µoªí©ó 2014-4-7 20:33

    Dim K As Integer, B As String
    For K = 0 To 0
    B = "v:\program\supertsc" & "\" & 1030403 - K & "?????" & ".xls" '§¹¾ãªº¸ô®|ÀɮצWºÙ
        [o1] = B
         If Dir(B) <> "" Then
      Workbooks.Open Filename:=B
       end if
        next

ÀɦW¬° 1030403ª`·N¦³°ÝÃD.xls
ÀˬdÀɮצ³¹L
¦ý¶}ÀɹL¤£¤F ?

TOP

¦^´_ 9# t8899
  1.    Dim K As Integer, B As String
  2.     For K = 0 To 0
  3.     B = "v:\program\supertsc" & "\" & 1030403 - K & "?????" & ".xls" '§¹¾ãªº¸ô®|ÀɮצWºÙ
  4.     '½Ð§A¥²¶·ª¾¹D  1030403 - K & "?????" & ".xls" <> 1030403ª`·N¦³°ÝÃD.xls
  5.         [o1] = B
  6.          MsgBOX Dir(B)   '¥iª¾Àɮ׬O§_¦s¦b
  7.          If Dir(B) <> "" Then
  8.       Workbooks.Open Filename:=B
  9.        end if
  10.         next

  11. ÀɦW¬° 1030403ª`·N¦³°ÝÃD.xls
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : °µ¦n¨Æ¤£¯à¤Ö§Ú¤@¤H¡A°µÃa¨Æ¤£¯à¦h§Ú¤@¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD