I have this macro where it enter in a cell the week's number followed by the date.
The problem i have is that the week's number is not good.
If i take for example, today, we are on week 50.
But is i activate the macro, the result i have is: Semaine:52 Sunday Dec 18 2011
How i can fix this?
Private Sub Calendar1_Click()
Dim t As Long
t = DateSerial(Year(D + (8 - Weekday(D)) Mod 7 - 3), 1, 1)
NumSemaine = ((D - t - 3 + (Weekday(t) + 1) Mod 7)) \ 7 + 1
ActiveCell.Value = "Semaine:" & NumSemaine & " " & Format(Calendar1.Value, "dddd mmm dd yyyy")