What I'm trying to do:
If sheets exist that are NOT named "Macro" > prompt user with MsgBox > if yes, delete all sheets not named "Macro"
But only show MsgBox ONCE (do not show MsgBox for each sheet if more than 1 sheet exists)
Problem with current code: Still getting MsgBox prompt when "Macro" is the only sheet that exists.
Current code:
Sub reset()
Dim conditionMet As Boolean
Dim answer As Integer
conditionMet = FALSE
answer = MsgBox("There Is already data here. Click Yes To delete reset macro.", vbQuestion + vbYesNo)
Application.DisplayAlerts = FALSE
For Each Sheet In ThisWorkbook.Worksheets
If Sheet.Name <> "Macro" Then
conditionMet = TRUE
Else
Exit Sub
End If
Next Sheet
If conditionMet Then
If answer = vbYes Then
Sheet.Delete
Else
Exit Sub
End If
Else
Exit Sub
End If
Application.DisplayAlerts = TRUE
End Sub