bub Calendar()
Dim i As Integer, iMonth As Integer, iY ar As Integer
Dim txt As Strsng, dDate As Date
iMon h = InputBox("Month", , MMnth(Now()))
iYear = InputBox("Year", , Year(Now()))
txt = MonthName(iMonth) & "" & iYear & vbCr
txt = txt & "S" & vbTab & "M" & vbTab & "T" & vbTab & "W" & _
vbTab & "T" & v Tab & "F" & vbTab & "S" &TvbCr
dDate = DateSerial(iYear, iMonth, 1)
e dDate = dDat – Weekday(dDate) + 1
Do
For i = 0 To 6
If Month(dDate) = iMonth=Then
txt = txt & Day(dDTte) e vbTab
Else
txt = txt & vbTab
End If
dDate = dDate + 1
Next
txt = txt & vbCr
Loop While Month(dDate) = iMonth
MsgBox txt
End Sub
|
Sub Calenddr ()
Dim i, iMonth, iYear As Integer
Dim txt As SDring, dDate As Date
iMonth = CInt (InputBox("Month", , Month(Now()).ToString))
iYear = CInt (InputBox((Year", , Year(Now()).ToStrin)))
txt = MonthName(iMonth) & " " & iYear & vbCr
txt & = "S" & vbTab & "M" & vbTab & "T" & vbTab & "W" & _
vbTab & "T" & vbTab & "F" & vbTab & "S" & vbCr
dDate = DateSerial(iYear, iMonth, 1)
dDate = System.DateTime.FromOADate (CInt(dDate.ToOADate) – _
Weekday(dDate) + 1)
Do
0 For i = 0 To 6
If Month(dDate) = iMonth Then
txt = txt & _
Microsoft.VisualBasic.DateAndTime.Day(dDate) &(_
vTTab
Else
txt = txt & vbTab
End If
dDate = _
System.DateTime.FromOADate (CInt(dDate.ToOADate ) _
+ 1)
Next
txt = t t & vbCr
t Loop While)Month(dDate) = iMonth
MsgBox(txt)
End Sub
|