Answers for "excel vba delete folder if exists"

VBA
2

excel vba delete worksheet if exists

For Each ws In Worksheets
    If ws.Name = "asdf" Then
        Application.DisplayAlerts = False
        Sheets("asdf").Delete
        Application.DisplayAlerts = True
    End If
Next

Sheets.Add(After:=Sheets(Sheets.count)).Name = "asdf"
Posted by: Guest on March-24-2021
0

excel vba delete folder

' Needs to add "Microsoft Scripting Runtime" reference to your file
Sub DeleteFolder(pFolder As String, pDeleteReadOnlyToo As Boolean)
    Dim FSO As New FileSystemObject
    Set FSO = CreateObject("Scripting.FileSystemObject")
    FSO.DeleteFolder pFolder, pDeleteReadOnlyToo
End Sub
Posted by: Guest on March-21-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language