Hi,
I have a list of worksheets on sheet1, i want to perform a do while loop to delete the sheets that are not equals to the sheets in the list so far i have this formula. Can someone help me see where I went wrong
![]()
Sub Delete() Dim ws As Worksheet Dim x As Integer x = 2 Do While Worksheets("Sheet1").Cells(x, 2) <> "" For Each ws In ActiveWorkbook If ws.Name <> Worksheets("Sheet1").Cells(x, 2) Then ws.Delete End If Next ws x = x + 1 Loop End Sub
Bookmarks