Hi all, working the weekend... again.
If anyone has any suggestions for shortening a lengthy AND statement down to something more pretty I will love you all forever as always
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For x = lastrow To 1 Step -1
If Cells(x, 3) <> Route(1) And _
Cells(x, 3) <> Route(2) And _
Cells(x, 3) <> Route(3) And _
Cells(x, 3) <> Route(4) And _
Cells(x, 3) <> Route(5) And _
Cells(x, 3) <> Route(6) And _
Cells(x, 3) <> Route(7) And _
Cells(x, 3) <> Route(8) And _
Cells(x, 3) <> Route(9) And _
Cells(x, 3) <> Route(10) And _
Cells(x, 3) <> Route(11) And _
Cells(x, 3) <> Route(12) And _
Cells(x, 3) <> Route(13) And _
Cells(x, 3) <> Route(14) And _
Cells(x, 3) <> Route(15) And _
Cells(x, 3) <> Route(16) And _
Cells(x, 3) <> Route(17) And _
Cells(x, 3) <> Route(18) And _
Cells(x, 3) <> Route(19) And _
Cells(x, 3) <> Route(20) Then
Rows(x).Delete
End If
Next x
This code isolates route numbers and only lets the ones defined in a range of cells that is then copied into the Route array variable. It works its just a little ugly.
Bookmarks