Forum Discussion
eightbitannotations
Sep 10, 2024Copper Contributor
Match Columns While Making Space for Dupicates
Hi all, I have two sheets with 10,000 rows that I need to match/sort, however, the 2nd set has multiples that need to be matched with a single value from the 1st list. Please see the example I have a...
HansVogelaar
Sep 10, 2024MVP
A macro:
Sub MatchCols()
Dim r As Long
Dim s As Long
Application.ScreenUpdating = False
r = 2
Do
If Range("M" & r) > Range("N" & r) Then
Range("M" & r).Insert Shift:=xlShiftDown
ElseIf Range("M" & r) < Range("N" & r) Then
Range("N" & r).Insert Shift:=xlShiftDown
End If
r = r + 1
Loop Until Range("M" & r).Value = ""
Application.ScreenUpdating = True
End Sub
Please test on a copy of the data.