Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ChangeSubstringOfDate()
- Dim WrkDate
- WrkDate = Date
- If (Application.Weekday(Date - 1, 2) = 7) Then ' for Sunday
- WrkDate = WrkDate - 2
- Else
- If (Application.Weekday(Date - 1, 2) = 6) Then ' for Saturday
- WrkDate = WrkDate - 1
- Else
- 'check for for holidays
- End If
- End If
- Range("C7").Value = Format(WrkDate - 1, "dd mm yy")
- '10-06-19'!F333+'10-06-19'!Y555-- change date to i.e. 06-06-19.
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement