Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Dim myLookupValue As Range
  2. Dim strResult As String
  3. Dim lngLastRow As Long
  4. Dim lngLoop As Long
  5. Dim ProjectManName As String
  6.  
  7. Set myLookupValue = Worksheets("Employees").Range("A1", Worksheets("Employees").Range("B1").End(xlDown))
  8.  
  9. With Worksheets("Project Summary")
  10.  
  11. lngLastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
  12.  
  13. For lngLoop = 2 To lngLastRow
  14. On Error Resume Next
  15. ProjectManName = .Cells(lngLoop, 1).Value
  16. strResult = Application.WorksheetFunction.VLookup(ProjectManName, myLookupValue, 2, False)
  17. Range("K" & lngLoop).Value = strResult
  18. ActiveCell.Offset(1, 0).Select
  19. Next
  20.  
  21. End With
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement