I had some help with this recently and its been working great until now!
I have just tried it again and have hit a snag - using the code below it is successfully deleting all but 'Anglia' which is being replaced with #N/A but the rows remain.
Dim Addr As String
Application.ScreenUpdating = False
With Sheets("Data Tab")
Addr = "A2:A" & Cells(Rows.Count, "A").End(xlUp).Row
Range(Addr) = Evaluate(Replace("IF(@=""Anglia"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Kent"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""LNW North"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""LNW South"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""No Route Defined"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Scotland"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Sussex"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Wales"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Wessex"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Western Thames Valley"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Western West"",""#N/A"",@)", "@", Addr))
On Error GoTo NoDeletes
Columns("A").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
End With
NoDeletes:
Application.ScreenUpdating = True[/QUOTE]
Guidance would be appreciated.
I have just tried it again and have hit a snag - using the code below it is successfully deleting all but 'Anglia' which is being replaced with #N/A but the rows remain.
Dim Addr As String
Application.ScreenUpdating = False
With Sheets("Data Tab")
Addr = "A2:A" & Cells(Rows.Count, "A").End(xlUp).Row
Range(Addr) = Evaluate(Replace("IF(@=""Anglia"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Kent"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""LNW North"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""LNW South"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""No Route Defined"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Scotland"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Sussex"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Wales"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Wessex"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Western Thames Valley"",""#N/A"",@)", "@", Addr))
Range(Addr) = Evaluate(Replace("IF(@=""Western West"",""#N/A"",@)", "@", Addr))
On Error GoTo NoDeletes
Columns("A").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
End With
NoDeletes:
Application.ScreenUpdating = True[/QUOTE]
Guidance would be appreciated.