|First, a posting tip:|
Please click on the blue line at the end of this post and read the instructions on how to post VBA code in this forum. It's much easier to read when it looks like the code below.
You'll see where I made the change that you requested.
Dim lastA, lastB, shortCol, rw As Integer
'Determine short column so we know when to stop
lastA = WorksheetFunction.CountA(Range("A:A"))
lastB = WorksheetFunction.CountA(Range("B:B"))
If lastA > lastB Then shortCol = 2 Else shortCol = 1
'Set First Check Row
rw = 1
'Check Column A against Column B, Row by Row
'Insert cell at non-matching data
'''''''''Include Column C at insert point
If Cells(rw, 1) <> "" And Cells(rw, 1) < Cells(rw, 2) Then
Range(Cells(rw, 2), Cells(rw, 3)).Insert shift:=xlDown
If Cells(rw, 2) <> "" And Cells(rw, 1) > Cells(rw, 2) Then
Cells(rw, 1).Insert shift:=xlDown
'If there is nothing left to check in the Short Column, we're done
If Cells(Rows.Count, shortCol).End(xlUp).Row + 1 = rw Then Exit Sub
'If not, increment Row counter and loop
rw = rw + 1
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.