excel vba中关于DATE类型的问题
求程序代码将DATE类型变量date1(例如2010-6-1615:25)转换成INTEGER类型变量year,month,day,hour,minute分别存储以及从这...
求程序代码将DATE类型变量date1(例如2010-6-16 15:25)
转换成INTEGER类型变量year,month,day,hour,minute分别存储
以及从这5个变量中重新得到DATE类型变量date2 展开
转换成INTEGER类型变量year,month,day,hour,minute分别存储
以及从这5个变量中重新得到DATE类型变量date2 展开
2个回答
展开全部
Dim dd As Date, a As Integer, b As Integer, c As Integer, d As Integer, e As Integer
dd = "2010-6-16 15:25"
a = Year(dd)
b = Month(dd)
c = Day(dd)
d = Hour(dd)
e = Minute(dd)
MsgBox a & b & c & d & e
dd = a & "-" & b & "-" & c & " " & d & ":" & e
MsgBox dd
End Sub
根据楼上改的
dd = "2010-6-16 15:25"
a = Year(dd)
b = Month(dd)
c = Day(dd)
d = Hour(dd)
e = Minute(dd)
MsgBox a & b & c & d & e
dd = a & "-" & b & "-" & c & " " & d & ":" & e
MsgBox dd
End Sub
根据楼上改的
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sub Macro1()
'
' Macro1 Macro
' 宏由 ynzsvt 录制,时间: 2010-10-11
'
Dim dd As Date
[A2] = Date
dd = "10/10/2010 13:55:45"
[a3] = dd
[a4] = Year(dd) & Month(dd) & Day(dd) & "-" & Hour(dd) & Minute(dd) & Second(dd)
End Sub
'
' Macro1 Macro
' 宏由 ynzsvt 录制,时间: 2010-10-11
'
Dim dd As Date
[A2] = Date
dd = "10/10/2010 13:55:45"
[a3] = dd
[a4] = Year(dd) & Month(dd) & Day(dd) & "-" & Hour(dd) & Minute(dd) & Second(dd)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询