Dim ws As Worksheet
Dim S As Integer
For S = 1 To Worksheets.Count
With Worksheets("Sheet Names")
Set ws = Worksheets(S)
.Cells(S, 1).Value = ws.Name
End With
Next S
Dim calcmode As Long
Dim ViewMode As Long
Dim myStrings As Variant
Dim FoundCell As Range
Dim I As Long
Dim myRng As Range
Dim sh As Worksheet
With Application
calcmode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
'We use the ActiveSheet but you can also use Sheets("MySheet")
Set sh = ActiveSheet
'We search in column A in this example
Set myRng = sh.Range("A:A")
'Add more search strings if you need
myStrings = Array("Home Screen", "Database", "What's Next", "Talent Charts", "Useful Links", "Collections Total", "AA Total", "CA Total", "CB Total", "AB Total", "LookUpLists", "Word", "Sheet Names", "Talent Menu")
'Home Screen, Database, Talent Charts
With sh
'We select the sheet so we can change the window view
.Select
'If you are in Page Break Preview Or Page Layout view go
'back to normal view, we do this for speed
ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView
'Turn off Page Breaks, we do this for speed
.DisplayPageBreaks = False
'We will search the values in MyRng in this example
With myRng
For I = LBound(myStrings) To UBound(myStrings)
Do
Set FoundCell = myRng.Find(What:=myStrings(I), _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
'Use xlPart If you want to search in a part of the FoundCell
'If you use LookIn:=xlValues it will also delete rows with a
'formula that evaluates to "Ron"
If FoundCell Is Nothing Then
Exit Do
Else
FoundCell.EntireRow.Delete
End If
Loop
Next I
End With
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = calcmode
End With
Range("A1").Select
Do Until ActiveCell.Value = ""
Me.cboSheetNames.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Loop
Application.ScreenUpdating = True