Hi everyone
There is an error 'End if without block if' with the code below:
Please could anyone help.
There is an error 'End if without block if' with the code below:
Please could anyone help.
Code:
[FONT=Calibri][SIZE=3][COLOR=#000000]Sub RemoveRows()[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] Sheet1.Select[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] Dim x As Long,LastRow As Long[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] LastRow = Cells(Rows.Count,"A").End(xlUp).Row[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] For x = LastRow To2 Step -1[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] If Cells(x,3).Value <> "FASS" And Cells(x, 3).Value <>"FBL" And Cells(x, 3).Value <> "LTI-A" And Cells(x,3).Value <> "STEM" _[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] AndCells(x, 3).Value <> "STEM" And Cells(x, 3).Value <>"MOOC FASS" And Cells(x, 3).Value <> "ApprentFBL" AndCells(x, 3).Value <> "ApprentSTEM" _[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] AndCells(x, 3).Value <> "PG FutureLearn" And Cells(x, 3).Value<> "MA Non-project" And Cells(x, 3).Value <>"Student Hub Live" _[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] AndCells(x, 3).Value <> "Editorial" And Cells(x, 3).Value <>"Editorial (Maintenance)" And Cells(x, 3).Value <>"Graphics" _[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] AndCells(x, 3).Value <> "IMD" And Cells(x, 3).Value <>"Learning Design" Then _[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] Rows(x).Delete[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] End If[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] Next x[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]End Sub[/COLOR][/SIZE][/FONT]