Hi,
im working on the project :
I got the code for making script dictionary working as vlookup from another spredsheet
Sub slownik_dzialajacy_xcol()
Const delim As String = "|"
Dim str As Variant
Dim a, i, u As Long
Dim dic As Object
Set dic = CreateObject("Scripting.Dictionary")
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
With Sheets("Arkusz1")
i = .Range("A" & .Rows.Count).End(xlUp).Row
u = .Cells(2 & .Columns.Count).End(xlToLeft).Column
a = .Range("A1:BU" & i).Value
For i = LBound(a, 1) To UBound(a, 1)
dic(a(i, 1)) = a(i, 2) & delim & a(i, 3) & delim & a(i, 4)
End With
With Sheets("Arkusz2")
For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
str = Split(dic(.Range("A" & i).Value), delim)
.Range("B" & i).Resize(, 4).Value = str
Erase str
Next i
End With
Set dic = Nothing
Erase a
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
This part of code making just straight vlookup based on a key from range A:A in sheet2 (and look it up in sheet1), and then put them in sheet2.
What i need to do is after this copying the dictionary would look in the source for reference and for example add values from Column O and Column P from sheet1 and put them next to vlookuped values in sheet2.
Best Regards,
Mumsy
Bookmarks