Sub 删除文件夹_()
Dim sfolder As String
sfolder = Application.InputBox(prompt:="请输入需要删除的文件夹名称:", _
Title:="输入文件夹", Type:=2)
sfolder = ThisWorkbook.Path & "\" & sfolder
If Len(Dir(sfolder & "\")) > 0 Then
MsgBox "文件夹" & sfolder & "中有文件,不能删除该文件夹!"
Else
RmDir sfolder
MsgBox "文件夹" & sfolder & "已经删除!"
End If
End Sub