Reputation: 1
I have this data in Excel:
I have this 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?
Upvotes: 0
Views: 59
Reputation: 20322
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
Upvotes: 1