Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vba 用户表单文本框中的日期不显示插入的数据_Vba_Date_Outlook_Textbox_Userform - Fatal编程技术网

Vba 用户表单文本框中的日期不显示插入的数据

Vba 用户表单文本框中的日期不显示插入的数据,vba,date,outlook,textbox,userform,Vba,Date,Outlook,Textbox,Userform,我有一个简单的用户表单,其中有一个文本框,用户在其中插入日期,另一个文本框,用户在其中插入数字。当我尝试使用表单中的数据时,它不会显示插入的数据:日期显示为12:00:00 am,数字显示为0 这是用户表单 Public Sub CancelButton_Click() Unload Me End End Sub Public Sub UserForm_Initialize() TextBox1.Value = "" TextBox2.Value = "" End Sub Publi

我有一个简单的用户表单,其中有一个文本框,用户在其中插入日期,另一个文本框,用户在其中插入数字。当我尝试使用表单中的数据时,它不会显示插入的数据:日期显示为12:00:00 am,数字显示为0

这是用户表单

Public Sub CancelButton_Click()
 Unload Me
 End
End Sub

Public Sub UserForm_Initialize()
 TextBox1.Value = ""
 TextBox2.Value = ""
End Sub

Public Sub btnOK_Click()
Dim xSO As Date
Dim ySO As String
 xSO = Format(TimeValue(TextBox1.Value), "dd.mm.yyyy")
 ySO = TextBox2.Value
Unload Me
End Sub
以下是最低要求:

Public xSO As Long, ySO As Long
    Sub ffffff()
    Dim x As Date, y As String
            UserForm19.Show

             x = xSO 'Format(TextBox1.Value, "dd.mm.yyyy")
             y = ySO 'UserForm19.TextBox2.text

    MsgBox x
    MsgBox y

    End Sub

您两次声明了xSO和ySO

从公用子btnOK_Click()中删除本地声明

Dim xSO As Date
Dim ySO As String