0

I have this data in Excel: Excel

I have this user form: user form

I click a date in the calendar and then output the data under that date in the first picture. how can i do it?

Leviathan
  • 2,468
  • 1
  • 18
  • 24

1 Answers1

1

Let's say your data is in cell 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 
ASH
  • 20,759
  • 19
  • 87
  • 200