Guest User

Untitled

a guest
Jul 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Private Sub Name_Change()
  2.  
  3. On Error Resume Next
  4. num.Value = Application.VLookup(Name.Value, Worksheets("Help").Range("C3:F5000"), 3, False)
  5.  
  6. ListBox1.Clear
  7.  
  8. Dim ws As Worksheet
  9. Dim ilastrow As Long
  10. Dim irow As Long
  11.  
  12. Set ws = Worksheets("Sheet1")
  13. ilastrow = ws.Range("B6000").End(xlUp).Row
  14.  
  15. For irow = 3 To ilastrow
  16. If Trim(ws.Range("B" & irow).Value) = Name.Value Then
  17. With ListBox1
  18. .AddItem Trim(ws.Range("E" & irow).Value) & " - " & Trim(ws.Range("F" & irow))
  19. End With
  20. End If
  21. Next irow
  22.  
  23.  
  24. End Sub
Add Comment
Please, Sign In to add comment