[vba] FolderCheck 함수를 이용한 폴더 생성
하나를하더라도최선을
2021-08-09 14:06:13
32,235
0
0
Public Function FolderCheck(fPath$) As String
Dim Folders As Variant, Path$, i%
Folders = Split(fPath, "\")
Path = Folders(0)
For i = 1 To UBound(Folders)
If Len(Folders(i)) Then
Path = Path + "\"
Path = Path + Folders(i)
If Len(Dir(Path + "\", vbDirectory)) = 0 Then MkDir Path
End If
Next
FolderCheck = Path + "\"
End Function