andielangley
Programmer
I have an excel spreadsheet containing a list of text strings in column A. What I want to do is write a loop to delete all rows until I find one that matches a specific pattern. The pattern is only part of the text string, not the whole line. I have this so far
Range("A1".Select
Do While ActiveCell.Value <> "*rows)*"
Range("A1".EntireRow.Delete
Range("A1".Select
Loop
which runs forever, presumably because the condition is never met. How do I correct this so that all rows prior to the one containing "rows)" are deleted? I'm sure it's obvious but I just can't see it!
Range("A1".Select
Do While ActiveCell.Value <> "*rows)*"
Range("A1".EntireRow.Delete
Range("A1".Select
Loop
which runs forever, presumably because the condition is never met. How do I correct this so that all rows prior to the one containing "rows)" are deleted? I'm sure it's obvious but I just can't see it!