View Full Version : Sleeper: Conditional rows deleting
ilyaskazi
06-20-2005, 04:19 AM
1) check rows upto last containing data in column-A and column-B
2) If column-A rows is bigger than column-B, delete all remaining rows of all columns and vice versa.
Bob Phillips
06-20-2005, 05:28 AM
Dim iLastRow As Long
Dim iLastRow2 As Long
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
iLastRow2 = Cells(Rows.Count, "B").End(xlUp).Row
If iLastRow > iLastRow2 Then
Cells(iLastRow2 + 1, "A").Resize(iLastRow - iLastRow2).EntireRow.Delete
ElseIf iLastRow < iLastRow2 Then
Cells(iLastRow + 1, "B").Resize(iLastRow2 - iLastRow).EntireRow.Delete
End If
ilyaskazi
06-20-2005, 07:44 AM
no i don't need leveling. You hv matched the rows of column-A with column-B.
If the last containing data is on row-5 of column-A and row-3 of column-B then
delete whole rows of all columns from row-6
Likewise to column-B if it is greater than column-A.
Also if both are matching then delete all from the next row.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.