Thread: [Solved] count and delete row
View Single Post
 
Old 09-28-2016, 09:27 PM
tomlam tomlam is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: Oct 2012
Posts: 33
tomlam is on a distinguished road
Default count and delete row

Dear Sir

We need your help
Each day we do thousand of sheets like as follow workdone.
We need to count the latest 15 records. For more than 15 records, we delete as
Yellow color row. That is the old record we need to delete. For less than 15 records,
We delete the yellow color row. After VBA code, The final result should be same as file named after. Attached pls find two file name before ,after

The vba code don’t work…pls help..many thanks

lastRow = Cells(Rows.Count, 1).End(xlUp).Row
For z = 1 To lastrow
If (Cells(z, ("c"))) = "" Then Cells(z, ("c")).EntireRow.Clear
Next z

Many Thanks
Tom
Attached Files
File Type: xls AFTER.xls (37.0 KB, 17 views)
File Type: xls BEFORE.xls (32.0 KB, 16 views)
Reply With Quote