Hello all, Using Excel 2007. I have two columns, and need to compare the two columns and if the numbers are the same, insert a cell above the mismatched cell in Column B. Been trying for hours to figure it out on my own. Any help would be greatly appreciated.

Bonus round: There's a third column that needs to be bumped down along with the mismatched number in column B. Example:

Data:

A B C

1 1 x

1 1 x

1 2 x

1 1 xResult:

A B C

1 1 x

1 1 x

1

1 2 x

1 1 xThanks so much in advance.

Try this... Sub InsertAtDifference() lastRw = Range("A" & Rows.Count).End(xlUp).Row For rw = 1 To lastRw If Cells(rw + 1, 2) <> Cells(rw, 2) Then Cells(rw + 1, 2).EntireRow.Insert Cells(rw + 1, 1) = Cells(rw - 1, 1) rw = rw + 2 End If Next End Sub

Click Here Before Posting Data or VBA Code --->How To Post Data or Code.

Ask Your Question

Weekly Poll

Would you ride in a self-driving car from Tesla?

Discuss in The Lounge

Poll History