The function can automatically give the number of future days from today on the week sleeve, as follows:
Monday: <%=getweek (1)%>
Tuesday: <%=getweek (2)%>
Wednesday: <%=getweek (3)%>
Thursday: <%=getweek (4)%>
The following is a reference fragment: Function Getweek (W) ' Original: Arisisi ' URL: www.alixixi.com ' Date: 2009-1-18 Dim w1,w2,w3,w4,w5,w6,w7 Dim D1,d2,d3,d4,d5,d6,d7
D1 = Day (now ()) W1 = Weekday (now ()) If w1 = W then Getweek = D1
D2 = Day (now () +1) W2 = Weekday (now () +1) If W2 = W then Getweek = D2 D3 = Day (now () +2) W3 = Weekday (now () +2) If W3 = W then Getweek = D3 D4 = Day (now () +3) W4 = Weekday (now () +3) If W4 = W then Getweek = D4 d5 = Day (now () +4) W5 = Weekday (now () +4) If W5 = W then Getweek = d5 D6 = Day (now () +5) W6 = Weekday (now () +5) If W6 = W then Getweek = d6 D7 = Day (now () +6) W7 = Weekday (now () +6) If W7 = W then Getweek = D7 End Function |