|
-
Feb 17th, 2006, 10:49 AM
#1
Thread Starter
Lively Member
[RESOLVED] Date cell format
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.
Last edited by thelocaluk; Feb 17th, 2006 at 07:56 PM.
-
Feb 17th, 2006, 01:11 PM
#2
Re: DTPicker cell format
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")
-
Feb 17th, 2006, 01:42 PM
#3
Thread Starter
Lively Member
Re: Date cell format
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.
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
I've figured it's the Now() statement that is causing the problem, does anyone know of a work around this??
Last edited by thelocaluk; Feb 17th, 2006 at 07:55 PM.
-
Feb 17th, 2006, 08:38 PM
#4
Thread Starter
Lively Member
Re: Date cell format
No worries, there was a problem with my registered controls.
Code:
Me.DTPicker1.Value = Format(Now(), "dd/mm/yyyy")
This works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|