如何将Excel中单元格的值输出到以date作为search参数的文本框中

我在Excel中有这个数据: 高强

我有这个用户表单: 用户表单

我点击日历中的date,然后在第一张图片中输出该date下的数据。 我该怎么做?

假设您的数据在D1单元格中。 。 。

Dim dDate As Date Private Sub CommandButton1_Click() Sheet1.Range("D1").Value = dDate End Sub Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) 'Dim dDate As Date dDate = DateSerial(Year(Date), Month(Date), Day(Date)) TextBox1.Value = Format(TextBox1.Value, "dd/mm/yyyy") dDate = TextBox1.Value End Sub