4个回答
展开全部
Private Sub Command1_Click()
Dim mydate As Date, Date1 As String
Dim mydate2
mydate = CDate(InputBox("请输入年月日(用-分开):", "输入", Date))
mydate2 = CDate(Year(mydate) & "-1-1")
MsgBox mydate & "是这一年的第" & DateDiff("d", mydate2, mydate) + 1 & "天!", vbOKOnly + 48, "信息"
End Sub
Dim mydate As Date, Date1 As String
Dim mydate2
mydate = CDate(InputBox("请输入年月日(用-分开):", "输入", Date))
mydate2 = CDate(Year(mydate) & "-1-1")
MsgBox mydate & "是这一年的第" & DateDiff("d", mydate2, mydate) + 1 & "天!", vbOKOnly + 48, "信息"
End Sub
展开全部
Private Sub Command1_Click()
Dim Ys As Integer, Ms As Integer, Ds As Integer, Days
Ys = Val(InputBox("输入年"))
Ms = Val(InputBox("输入月"))
Ds = Val(InputBox("输入日"))
Days = DatePart("y", Ys & "-" & Ms & "-" & Ds)
Print "当年的第" & Days & "天"
End Sub
Dim Ys As Integer, Ms As Integer, Ds As Integer, Days
Ys = Val(InputBox("输入年"))
Ms = Val(InputBox("输入月"))
Ds = Val(InputBox("输入日"))
Days = DatePart("y", Ys & "-" & Ms & "-" & Ds)
Print "当年的第" & Days & "天"
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'很简单的
days = DatePart("y", Date)
days = DatePart("y", Date)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
datediff
我服你了
我服你了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询