I'm have issue running this code. I keep getting getting a compile error: for without Next. Can you guys please help.
Sub DeleteRows_BASEMENT(IRibbonControl)
Dim sht As Worksheet, myShts As Variant
myShts = Array("PARENT VIEWS", "Child Sheet Index") '<-- list all the sheet names you want the code to run on here
For i = LBound(myShts) To UBound(myShts)
If i = LBound(myShts) Then
Sheets(myShts(i)).Select Replace:=True
Else
Sheets(myShts(i)).Select Replace:=False
End If
For Each sht In ActiveWindow.SelectedSheets
Last = Cells(Rows.Count, "D").End(xlUp).Row
For a = Last To 1 Step -1
If (Cells(a, "D").Value) Like "*BASEMENT*" Then
Cells(a, "D").EntireRow.Delete
Exit For
End If
Next a
End Sub
Sub DeleteRows_BASEMENT(IRibbonControl)
Dim sht As Worksheet, myShts As Variant
myShts = Array("PARENT VIEWS", "Child Sheet Index") '<-- list all the sheet names you want the code to run on here
For i = LBound(myShts) To UBound(myShts)
If i = LBound(myShts) Then
Sheets(myShts(i)).Select Replace:=True
Else
Sheets(myShts(i)).Select Replace:=False
End If
For Each sht In ActiveWindow.SelectedSheets
Last = Cells(Rows.Count, "D").End(xlUp).Row
For a = Last To 1 Step -1
If (Cells(a, "D").Value) Like "*BASEMENT*" Then
Cells(a, "D").EntireRow.Delete
Exit For
End If
Next a
End Sub