BBATESJR15
New Member
- Joined
- Feb 23, 2018
- Messages
- 3
Dim c As Range
Dim Remove As Integer
Remove = Sheets("TEST").Range("A" & Rows.Count).End(xlUp).Row
For Each c In Sheets("TEST").Range("A1:A" & Remove)
If Len(c) <= 8 Then
c.EntireRow.Delete
End If
Next c
Hi,
I'm using the code above to delete rows that have 8 characters or less. The code is working, but I have to run the macro a least 5-6 time before it removes all of the rows that have 8 characters or less. I have used this line of code a few times and I've never had this problem. It seems to a counting issue because it's skipping rows as it looks for the info. Any help would be greatly appreciated.
Thanks,
B
Dim Remove As Integer
Remove = Sheets("TEST").Range("A" & Rows.Count).End(xlUp).Row
For Each c In Sheets("TEST").Range("A1:A" & Remove)
If Len(c) <= 8 Then
c.EntireRow.Delete
End If
Next c
Hi,
I'm using the code above to delete rows that have 8 characters or less. The code is working, but I have to run the macro a least 5-6 time before it removes all of the rows that have 8 characters or less. I have used this line of code a few times and I've never had this problem. It seems to a counting issue because it's skipping rows as it looks for the info. Any help would be greatly appreciated.
Thanks,
B