- Function gdate(TheDay)
- Dim WeekNum
- WeekNum = Weekday(TheDay, 2)
- For i = 1 To 7
- num = i -1
- If i = WeekNum Then
- If WeekNum = 1 Then '如果日期是周一
- gdate = begday
- Else
- gdate = DateAdd("d", - num, TheDay) '如果日期不是周一
- End If
- Exit For
- End If
- Next
- End Function
复制代码
|