Results 1 to 3 of 3

Thread: Solved: Problem delete and replace item

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Question Solved: Problem delete and replace item

    I tired this code to delete some groups of items and replace the their below item in their place as you see in the pic.

    [vba]Dim LastRow As Long, i As Long
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = LastRow To 1 Step -1
    If UCase(Range("B" & i).Value) = "C" And Range("A" & i).Value = 33 Then
    Range("A" & i).Delete xlShiftUp
    Range("B" & i).Resize(, 5).Delete xlShiftUp

    End If
    Next i
    [/vba]

    The problem that I faced, the result didn't keep the last arrangement, it's mean it left tow rows not one row as in the first. How to fix this problem. By the way I don't want to delete and replace a row only the items
    I hope I'm clear
    Last edited by Nader; 03-19-2008 at 04:06 PM.

Posting Permissions

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