Guest User

Untitled

a guest
Mar 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Private Sub Go_Click()
  2. With Worksheets(1).Range("A:A")
  3. 'Search from user input for the entry with that last name
  4. Set c = .Find(LNE.Text, , xlValues, xlWhole)
  5. If Not c Is Nothing Then
  6. Dim wb As Workbook
  7. Set wb = Workbooks.Add("DocumentsCustom Office TemplatesKFS_Template.xltm")
  8.  
  9. StartDate = c.Offset(0, 3)
  10. EndDate = c.Offset(0, 4)
  11. If DateDiff("d", SDE.Text, StartDate) > -1 Then
  12. If DateDiff("d", EndDate, EDE.Text) > -1 Then
  13. Set q = Range("A1")
  14. wb.Sheets("Sheet1").Range("A6").Value = ThisWorkbook.Sheets("Sheet1").Range(c.Offset(0, 8)).Value
  15. End If
  16. End If
  17. End If
  18. End With
  19. End Sub
Add Comment
Please, Sign In to add comment