L
Legacy 259939
Guest
I have a macro that searches through data and finds the word TEST in column A then deletes the entire row (the test record). It worked fine for months but recently has stopped working. Nothing has changed. I cannot figure out why it is not working. Below is the code and a sample of the data.
Thanks in advance for any help!
P.S. I am using excel 2007
<tbody>
</tbody>
Thanks in advance for any help!
P.S. I am using excel 2007
Code:
Sub Step_1()
'
' Step_1 Macro
'
'Deletes all TEST records
Sheets("RawData").Select
On Error Resume Next
Dim cl As Range, c As Range
With ActiveSheet.Range("a:a")
Set c = .Find("TEST", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Set cl = c
Set c = .FindNext(c)
cl.EntireRow.Delete Shift:=xlToLeft
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
code | Cust | TRX_no | Date | Due Date |
69 | REG1 | 91010234 | 3/19/2014 | 3/27/2014 |
69 | REG1 | 91010248 | 3/19/2014 | 3/27/2014 |
1 | REG2 | 81011128 | 3/20/2014 | 3/27/2014 |
1 | REG2 | 91012312 | 3/21/2014 | 3/27/2014 |
TEST | Test | 8918543 | 9/13/2013 | 9/23/2013 |
TEST | Test | 8921516 | 9/19/2013 | 9/27/2013 |
TEST | Test | 8937459 | ######## | ######## |
TEST | Test | 8937461 | ######## | ######## |
TEST | Test | 8938711 | ######## | 11/1/2013 |
TEST | Test | 7968354 | ######## | 1/2/2014 |
TEST | Test | 6968550 | ######## | 1/2/2014 |
TEST | Test | 7977427 | 1/14/2014 | 1/23/2014 |
TEST | Test | 9983051 | 1/24/2014 | 2/3/2014 |
TEST | Test | 8983052 | 1/24/2014 | 2/3/2014 |
TEST | Test | 9990282 | 2/10/2014 | 2/19/2014 |
TEST | Test | 9996079 | 2/21/2014 | 3/3/2014 |
TEST | Test | 1004413 | 3/11/2014 | 3/19/2014 |
<tbody>
</tbody>