Delete Rows in VBA
Posted by Shamsuddeen. P.K on January 07, 2002 10:47 AM
I have downloaded and formatted a text file to excel thru VBA macro. The file contains more than 100 records. Column H contains Total of colums A to G.
I want to delete all the records (with the help of a macro) whose Totals are 0 (cloumn H). I have tried the following macro which deletes most of the rows but some are left undeleted.
For i = 1 to LastRow ' LastRow = Total No. of records
If cells(i,8).value = 0
Range("H" & i).EntireRow.Delete