Consulting

Results 1 to 3 of 3

Thread: Sleeper: Conditional rows deleting

  1. #1

    Question Sleeper: Conditional rows deleting

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •