Quote:
Originally Posted by Kimberly
Code:
Sub FixList()
Range("A1").Select
Do
If (ActiveCell.Value > ActiveCell.Offset(0, 1)) Then
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Else: ActiveCell.Offset(1, 0).Range("A1").Select
End If
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub
Be sure to do this on a copy of your worksheet, not the original.
The macro will quit when it encounters a row where col B is empty.
|
Well, thanks again, you did solve the problem, but I need more than that, attached is an example contains "Before" and "After" sheets that exactly describe the other problem I faced when applying your solution.
Mainly the code you posted didn't allow me to insert an entire row, and when I switch the columns the code didn't work. Please see the attached file and give me your feedback.
P.S. I also updated the example attached in the thread subject.