I have a column that stores dates selected from a datepicker control. In the cells it hides the time even though the cell is formated dd/mm/yyyy??
I get the data into a ListBox and get the date and time, I only want to see the date.
Printable View
I have a column that stores dates selected from a datepicker control. In the cells it hides the time even though the cell is formated dd/mm/yyyy??
I get the data into a ListBox and get the date and time, I only want to see the date.
Could you please explain more clearly?
anyway,
If you work in Excel,
If you add the cell value to list1 list box, use the format function:
VB Code:
list1.additem format(Range("A1").value, "DD/mm/yyyy")
When the data loads into a list box the date displays the time, even though the cells only display dd/mm/yyyy. I want to list the date without the time showing.
I've figured it's the Now() statement that is causing the problem, does anyone know of a work around this??Code:Private Sub UserForm_Activate()
Set MyData = Sheet2.Range("a2").CurrentRegion
Me.DTPicker1.Value = Now()
Me.cmbAmend.Enabled = False
Me.cmbAdd.Enabled = True
Me.txtId.SetFocus
Me.Height = 370
End Sub
No worries, there was a problem with my registered controls.
This works :)Code:Me.DTPicker1.Value = Format(Now(), "dd/mm/yyyy")