Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2011 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1339966 to your computer and use it in GitHub Desktop.
Save anonymous/1339966 to your computer and use it in GitHub Desktop.
Range("B4").Select
Do While (IsEmpty(ActiveCell) = False Or IsEmpty(ActiveCell.Offset(1, 0)) = False)
If ActiveCell.Value = ActiveCell.Offset(0, 1) Or ActiveCell.Offset(1, 0).Value = ActiveCell.Offset(1, 1) Then
ActiveCell.Offset(1, 0).Select
Else
If ActiveCell.Offset(1, 0).Value = ActiveCell.Offset(0, 1) Then
ActiveCell.Range("B1:C1").Select
Selection.Insert Shift:=xlDown
Else
ActiveCell.Range("B1:C1").Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(0, -2).Select
End If
End If
Loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment