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

[µo°Ý] Dir ¶×¥X«ü¥O¥i§_±Æ°£ ¥Ø¿ý©O?

¦^´_ 3# prin.huang


Sub P_Sample004()
    Dim myFileName As String
    myFileName = Application.InputBox(Prompt:= _
        "½Ð¿é¤JÀɮצWºÙ¡B¸ê®Æ§¨¦WºÙªº§¹¾ã¸ô®|", Title:="½T»{¦s¦b")
    If Len(Dir(myFileName, vbDirectory)) > 0 Then
        If (GetAttr(myFileName) And vbDirectory) = vbDirectory Then
            MsgBox "©Ò«ü©w¤§¸ê®Æ§¨¦s¦b¡C"
       Else
            MsgBox "©Ò«ü©w¤§Àɮצs¦b¡C"
       End If
    Else
        MsgBox "©Ò«ü©w¤§ÀɮשάO¥Ø¿ý¤£¦s¦b¡C"
    End If
End Sub

Sub P_Sample003()
    Dim myPath     As String
    Dim myFileName As String
    Dim i          As Long
    myPath = ThisWorkbook.Path & "\"        '¥ô·Nªº¸ê®Æ§¨
    myFileName = Dir(myPath, 0)
    Do While Len(myFileName) > 0
        Debug.Print myPath & myFileName
        myFileName = Dir()
    Loop
End Sub

TOP

        ÀR«ä¦Û¦b : ¯¸¦b¥b¸ô¡A¤ñ¨«¨ì¥Ø¼Ð§ó¨¯­W¡C
ªð¦^¦Cªí ¤W¤@¥DÃD