有人可以帮我这个代码吗? 如何打开现有文件夹?
Sub click button()
Dim folderpath As String
folderpath = "c:\"
Dim rng As Range
Set rng = Range(Selection.Address)
Dim col As Range
For Each col In rng.Rows
If Dir(folderpath + CStr(col.Rows), vbDirectory) = "" Then
Dim response
response = MsgBox("Folder:" & col.Rows & " doesnt exist. Do you want to create it?", vbYesNo, "Folder")
If response = vbYes Then
MkDir (folderpath + CStr(col.Rows))
End If
Else
MsgBox "Folder:" & col.Rows & " exists"
End If
Next col
End Sub