Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Sub ChangeSubstringOfDate()
  2.  
  3. Dim WrkDate
  4. WrkDate = Date
  5. If (Application.Weekday(Date - 1, 2) = 7) Then ' for Sunday
  6. WrkDate = WrkDate - 2
  7. Else
  8. If (Application.Weekday(Date - 1, 2) = 6) Then ' for Saturday
  9. WrkDate = WrkDate - 1
  10.  
  11. Else
  12. 'check for for holidays
  13.  
  14.  
  15.  
  16. End If
  17. End If
  18.  
  19. Range("C7").Value = Format(WrkDate - 1, "dd mm yy")
  20.  
  21. '10-06-19'!F333+'10-06-19'!Y555-- change date to i.e. 06-06-19.
  22.  
  23.  
  24.  
  25. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement