在VBA中的文本框中格式化MM / DD / YYYY日期格式

时间:2019-02-28 23:06:37

标签: excel vba

来自HTH的select_label过程

Private Sub select_label(msForm_C As MSForms.Control)
    '/* Capture the selected date */
    Dim i As Integer, sel_date As Date
    i = Split(msForm_C.Name, "_")(1) - 1
    sel_date = FirstCalSun(curMonth) + i

    '/* Transfer the date where you want it to go */
    MsgBox sel_date

End Sub

我有一个包含以下代码的TextBox1的UserForm1

Private Sub TextBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
SelectDate.Show
End Sub

问题如下,如何将我的代码链接到TextBox1”,并在sel_date显示在TextBox1(UserForm1)上,TextBox1没有值并收集sel_date值,此操作应处于循环中,以便我可以访问日期选择器根据需要多次更改日期 感谢您的帮助

0 个答案:

没有答案