It's important you mention when you post at other forums because we can then avoid the possibility of somebody spending time solving a problem which has already been solved elsewhere. You should have mentioned it at Ozgrid too.
I think this works for your example. It does assume the two sheets have the same number of columns.
Sub x()
Dim vOut(), vIn(), i As Long, j As Long, n As Long, oDic As Object, r1 As Long, r2 As Long, c As Long
With Sheets("Wk1")
r1 = .Range("A1").CurrentRegion.Rows.Count - 1
c = .Range("A1").CurrentRegion.Columns.Count
vIn = .Range("A2").Resize(r1, c).Value
End With
r2 = Sheets("Wk2").Range("A1").CurrentRegion.Rows.Count - 1
ReDim vOut(1 To r1 + r2, 1 To c)
Set oDic = CreateObject("Scripting.Dictionary")
With oDic
For i = 1 To UBound(vIn, 1)
If Not .Exists(vIn(i, 1)) Then
n = n + 1
For j = 1 To UBound(vIn, 2)
vOut(n, j) = vIn(i, j)
Next j
.Add vIn(i, 1), n
End If
Next i
End With
vIn = Sheets("Wk2").Range("A2").Resize(r2, c).Value
With oDic
For i = 1 To UBound(vIn, 1)
If Not .Exists(vIn(i, 1)) Then
n = n + 1
For j = 1 To UBound(vIn, 2)
vOut(n, j) = vIn(i, j)
Next j
.Add vIn(i, 1), n
Else
For j = 2 To UBound(vIn, 2)
If vOut(.Item(vIn(i, 1)), j) = "" And vIn(i, j) <> "" Then
vOut(.Item(vIn(i, 1)), j) = vIn(i, j)
End If
Next j
End If
Next i
End With
With Sheets("Merged").Range("A1")
.Resize(, c).Value = Sheets("Wk1").Range("A1").Resize(, c).Value
.Resize(, c).Font.Bold = True
.CurrentRegion.Offset(1).ClearContents
.Offset(1).Resize(n, c) = vOut
End With
End Sub
Bookmarks