Some of the cells have duplicates values, so the return would also be 2,3 or 4 times.
Sub copyfrom()
Dim c3 As Range, c4 As Range, LR2 As String, ms As Worksheet, LR1&
Application.ScreenUpdating = 0
Application.EnableEvents = 0
Set ms = Sheets("MyDB")
With Sheets("LWDB")
LR1 = ms.Cells(Rows.Count, 1).End(xlUp).Row
LR2 = Worksheets("LWDB").Cells(Rows.Count, 1).End(xlUp).Row
For Each c4 In .Range("A2:A" & LR2)
Set c3 = ms.Range("A2:A" & Rows.Count).Find(c4, , xlValues, xlWhole)
If Not c3 Is Nothing Then
c3.Offset(1, 1).EntireRow.Insert
c4.Resize(, 7).Copy
ms.Cells(c3.Row + 1, 2).PasteSpecial xlValues
Else
c4.Resize(, 7).Copy
ms.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlValues
End If
Next
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
Set ms = Nothing
End Sub
Bookmarks