SHARE
TWEET

Untitled

a guest Jun 16th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top