Private Sub Command1_Click()
Dim StartDatum
Dim vMonth
Dim vYear
Dim StartDag
Dim vRow%, vColomn%
Const t1% = 5
Const t2% = 10
Const t3% = 15
Const t4% = 20
Const t5% = 25
Const t6% = 30
Dim c%
Dim GoFurther%
StartDatum = InputBox("which first date", , Format(Now, "dd-mm-yy"))
If StartDatum = "" Then Exit Sub
vMonth = Month(StartDatum)
vYear = Year(StartDatum)
StartDatum = CDate("1-" & vMonth & "-" & vYear)
StartDag = DatePart("w", StartDatum)
'1=sunday
'2=monday
'etc
GoFurther% = False
Printer.Print StartDatum
Printer.Print "S"; Tab(t1); "M"; Tab(t2); "T"; Tab(t3); "W"; _
Tab(t4); "T"; Tab(t5); "F"; Tab(t6); "S"
Screen.MousePointer = vbHourglass
For vRow% = 1 To 6
For vColomn% = 1 To 7
If (StartDag = vColomn% And Not GoFurther%) Then
c% = 1
Printer.Print Str(c%);
GoFurther% = True
Else
If (GoFurther% And IsDate(CStr(c%) & "-" & vMonth & _
"-" & vYear)) Then Printer.Print Str(c%);
End If
Select Case vColomn%
Case 1
Printer.Print Tab(t1);
Case 2
Printer.Print Tab(t2);
Case 3
Printer.Print Tab(t3);
Case 4
Printer.Print Tab(t4);
Case 5
Printer.Print Tab(t5);
Case 6
Printer.Print Tab(t6);
End Select
c% = c% + 1
Next vColomn%
Printer.Print
Next vRow%
Printer.EndDoc
Screen.MousePointer = vbNormal
End Sub
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。