-
how say the monday for next week example:
if day es tuesday how say the next monday the date
EX: tuesday 29/8/00 the next monday is 4/9/00
else is thursday or friday or saturday or sunday ever say the next monday of next week
sorry my bad english
thanx
-
Here's an example:
Code:
Dim dte As Date
Dim iAdd%
dte = InputBox("Enter a valid date")
iAdd = 8 - Weekday(dte, vbMonday)
MsgBox "Next monday is: " & DateAdd("d", iAdd, dte)
-
I like Joacim's answer, but here is another way
Code:
Dim intDay As Integer
For intDay = 1 To 7
If Format(Date + intDay, "ddd") = "Mon" Then
MsgBox "Next Monday is " & Date + intDay
Exit For
End If
Next
-
Well Martin that assumes that the Format function will return "Mon" for monday.
That may not be True. It depends on the locals setting. My computer returns "Mån" because I'm located in Sweden.