Sub GetFolder()
Dim FolderName, FileName, MyFolder, MyFile As String
FolderName = "abc"
FileName = "abc.xls"
MyFolder = Dir("D:\" & FolderName, 16)
MyFile = Dir("D:\" & FolderName & "\" & FileName, 16)
If MyFolder <> "" Then
MsgBox "The folder is OK"
Else
MkDir "D:\" & FolderName
End If
If MyFile <> "" Then
MsgBox "The File is OK"
Else
Open "D:\" & FolderName & "\" & FileName For Output As #1
Close #1
End If
End Sub
追问您好,多谢您提供的代码。麻烦你再帮我看看,我需要用A列中的名称批量新建文件夹存放到B列指定的路径下。
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/a08b87d6277f9e2f68bfb5a11430e924b999f395?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
本回答被提问者和网友采纳