Hello Excel Forum,
If I could reach for some help from anyone with my below VBA. [new to VBA 🙂]
Changes are expected to be made in Columns: DEFG.
RE: From Attachments
[Sub test()
Dim a, i As Long, dic As Object
Application.ScreenUpdating = False
Set dic = CreateObject("Scripting.Dictionary")
'sheet1 as the datasource that will be used to reflect changes to sheet2
a = Sheets("sheet1").Cells(1).CurrentRegion.Columns(1).Value
For i = 2 To UBound(a, 1)
dic(a(i, 1)) = i
Next
'sheet2 as the destination that will be used to reflect changes from sheet1
With Sheets("sheet2")
a = .Cells(1).CurrentRegion.Columns(1).Value
For i = 2 To UBound(a, 1)
If dic.exists(a(i, 1)) Then
Sheets("sheet1").Rows(dic(a(i, 1))).Copy .Rows(i)
dic.Remove a(i, 1)
End If
Next
If dic.Count Then
For i = 0 To dic.Count - 1
Sheets("sheet1").Rows(dic.items()(i)).Copy _
Destination:=.Range("a" & Rows.Count).End(xlUp)(2)
Next
End If
End With
Application.ScreenUpdating = True
End Sub
]
Bookmarks