简体   繁体   English

消息框上的日期-VBA

[英]Date on message box - VBA

I performed code below to show date on message box. 我执行以下代码以在消息框中显示日期。 However, the value in code is not the same with showing value on message box. 但是,代码中的值与消息框上显示的值不同。 Could you please help me to know the reason? 你能帮我知道原因吗?

code VB: 代码VB:

Sub Button1_Click()
Dim birthday As Date
birthday = 27 / 11 / 1992 'dd/mm/yyy
abc = MsgBox("Birthday: " & Format(birthday, "dd/mm/yyyy"), 3, "Choose option")
End Sub

message box result 消息框结果

采用 :

 birthday = "27 / 11 / 1992"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM