Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Sub UGvlookup()
  2. Dim cl As Range, Dic As Object
  3. Set Dic = CreateObject("Scripting.Dictionary"): Dic.Comparemode = vbTextCompare
  4.  
  5.  
  6. With Sheets("Sheet A")
  7. For Each cl In .Range("B2:B" & .Cells(Rows.count, "C").End(xlUp).Row)
  8. If Not Dic.exists(cl.Value) Then Dic.Add cl.Value, cl.Row
  9. Next cl
  10. End With
  11. With Sheets("Sheet B")
  12. For Each cl In .Range("A2:A" & .Cells(Rows.count, "A").End(xlUp).Row)
  13. If Dic.exists(cl.Value) Then
  14. Sheets("Latency").Cells(Dic(cl.Value), 17) = "UG"
  15. End If
  16. If Dic.exists(cl.Value) Then
  17. Sheets("Latency").Cells(Dic(cl.Value), 17) = "UG"
  18. Dic.Remove (cl.Value)
  19. End If
  20. Next cl
  21. End With
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement