The code I provided deletes all sheets in a workbook that starts with the name “*SHEETS*”. How can I modify so it only deletes the Active sheet if it starts with “*SHEETS*”.
VBA Code:
Dim wsheet As Worksheet
For Each wsheet In ThisWorkbook.Worksheets
If UCase(wsheet.Name) Like "*SHEET*" Then
Application.DisplayAlerts = False
wsheet.Delete
Application.DisplayAlerts = True
End If