- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# taiwan
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim xDir As String, i As Integer, Ay(), Ar(), s As Variant
- Dim xPath As String
- xPath = "A:\"
- xDir = Dir(xPath & Format(Date, "yyyy-mm-dd") & "*.xls", vbDirectory)
- 'Dir: ªí¥Ü¦X¥G±ø¥ó¡BÀÉ®×ÄÝ©Ê¡BºÏºÐ¼Ð°Oªº¤@ÓÀɮצWºÙ¡B©Î¥Ø¿ý¡BÀɮק¨¦WºÙ¡C
- If xDir = "" Then MsgBox "¨S¦³³Ì·sÀÉ®×": Exit Sub
- Do While xDir <> ""
- ReDim Preserve Ar(0 To i) '°}¦C:«O«ù즳¤¸¯À,«·s°t¸m°ÊºA°}¦CÅܼƪºÀx¦sªÅ¶¡¡C
- ReDim Preserve Ay(0 To i)
- Ar(i) = xDir
- Ay(i) = Val(Replace(Split(xDir, " ")(1), ".xls", "")) '¨ú±o¼Æ¦r
- i = i + 1
- xDir = Dir '¤U¤@Ó ¦X¥G±ø¥óªºÀÉ®×
- Loop
- s = Application.Max(Ay)
- s = Application.Match(s, Ay, 0)
- If MsgBox("¶}±Ò³Ì·s ÀÉ®× " & vbTab & Ar(s - 1) & vbLf & Join(Ar, vbLf), vbYesNo) = vbYes Then
- Workbooks.Open xPath & Ar(s - 1)
- End If
- End Sub
½Æ»s¥N½X |
|