duncansancho
Technical User
I frequently produce lists which then need pruning according to adjacent information and would like to know the quickest and most efficient way of doing this with VBA.
For example I may have a column of 6000 entries in column A, and must remove all entries next to a "1" in column B. At present my code is as follows but it is slow and inefficient
Range("A1"
.Select
Do Until ActiveCell = ""
Do While ActiveCell.Offset(0, 1) = 1
Selection.EntireRow.Delete
Loop
ActiveCell.Offset(1, 0).Range("A1"
.Select
Loop
Any help much appreciated
Duncan
For example I may have a column of 6000 entries in column A, and must remove all entries next to a "1" in column B. At present my code is as follows but it is slow and inefficient
Range("A1"
Do Until ActiveCell = ""
Do While ActiveCell.Offset(0, 1) = 1
Selection.EntireRow.Delete
Loop
ActiveCell.Offset(1, 0).Range("A1"
Loop
Any help much appreciated
Duncan