chiswickbridge
Board Regular
- Joined
- Feb 2, 2013
- Messages
- 126
I have a data base in columns A:H max to 99999 rows, commencing from Row 10 as Header and Row 11 to 99999 as data
<tbody>
</tbody>
I want to delete Rows,
First Criteria - when Col A is Null value
Second Criteria when Col H is less than 99 or a certain number that I specify in Cell H5
this below vba...runs very slow as the rows are about 85000
Sub delrow() 'DELETES ANY ROW IN COLUMN "H" THAT IS BLANK
Dim i As Long
For i = Cells(Rows.Count, "A").End(xlUp).Row To 10 Step -1
If Range("H" & i).Value < 99 Then Rows(i).Delete
Next i
End Sub
Can I have a vba, that sorts Col A from A to Z, and at the first instance of a Null value....deletes everthing below it
and then sorts Col H from Highest to Lowest, and at the first instance, when cell in H Column is below 99...it deletes everyhing below it.
Thanks.....
Col A | Col B | Col C | Col D | Col E | Col F | Col G | Col H | ||
AAA | 560 | ||||||||
BBB | 45 | ||||||||
CCC | 453 | ||||||||
DDD | 125 | ||||||||
452 | |||||||||
EEE | 478 | ||||||||
12 | |||||||||
FFF | 15 | ||||||||
<tbody>
</tbody>
I want to delete Rows,
First Criteria - when Col A is Null value
Second Criteria when Col H is less than 99 or a certain number that I specify in Cell H5
this below vba...runs very slow as the rows are about 85000
Sub delrow() 'DELETES ANY ROW IN COLUMN "H" THAT IS BLANK
Dim i As Long
For i = Cells(Rows.Count, "A").End(xlUp).Row To 10 Step -1
If Range("H" & i).Value < 99 Then Rows(i).Delete
Next i
End Sub
Can I have a vba, that sorts Col A from A to Z, and at the first instance of a Null value....deletes everthing below it
and then sorts Col H from Highest to Lowest, and at the first instance, when cell in H Column is below 99...it deletes everyhing below it.
Thanks.....