Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim x, x2, y, y2()
- Dim i As Long
- Dim dict As Object
- Dim LastRowTwo As Long, shtOrders As Worksheet, shtReport As Worksheet
- Set shtOrders = Worksheets("Orders")
- Set shtReport = Worksheets("Mapping")
- Set dict = CreateObject("Scripting.Dictionary")
- With shtReport
- LastRow = .Range("G" & Rows.Count).End(xlUp).Row
- x = .Range("G2:G" & LastRow).Value
- x2 = .Range("I2:I" & LastRow).Value
- Set SelectionRNG = Worksheets("Mapping").Range("G2:J" & LastRow)
- For Each rngrow In SelectionRNG.Rows
- If rngrow.Cells(1, 4) = "100" Then
- dict.Item(x(i, 1)) = x2(i, 1)
- End If
- Next
- End With
- dict.Item(x(i, 1)) = x2(i, 1)
- For i = 1 To UBound(x, 1)
- dict.Item(x(i, 1)) = x2(i, 1)
- Next i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement