can there be a solution that works if the worksheet names on column B are like made up of alphabets.
can there be a solution that works if the worksheet names on column B are like made up of alphabets.
Hi kchm_2000
Try this codeLet me know of issues.![]()
Option Explicit Sub Find_ws() Dim ws As Worksheet Dim Findws As String Dim Rng As Range Dim LR As Long Application.ScreenUpdating = False LR = Range("B" & Rows.Count).End(xlUp).Row For Each ws In ActiveWorkbook.Worksheets Findws = ws.Name If Trim(Findws) <> "" Then With Sheets("Sheet1").Range("B2:B" & LR) Set Rng = .Find(What:=Findws, _ After:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not Rng Is Nothing Then ' do nothing Else If ws.Name <> ActiveSheet.Name Then Application.DisplayAlerts = False ws.Delete Application.DisplayAlerts = True End If End If End With End If Next ws Application.ScreenUpdating = True End Sub
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please mark your Thread as SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks