Free for PREMIUM members
Go Premium for a chance to win a PS4. Enter to Win
Dim e As String, iRow As Long, ws As Worksheet, main As Worksheet
Set main = ActiveSheet
e = ActiveSheet.Range("A2").Value
ActiveSheet.AutoFilterMode = False
iRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(0, 0).Row
If Application.WorksheetFunction.CountIf(Range("A5:A" & iRow), e) > 0 Then
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = e Then
Application.DisplayAlerts = False
MsgBox "Deleted " & e, vbInformation
MsgBox "Your selection is not found among the list!", vbExclamation
Open in new window
Author Closing Comment
Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.
Join & Ask a Question
Join our community for more solutions or to ask questions.
For immediate help use Live now!