Results 1 to 4 of 4

Thread: [RESOLVED] Date cell format

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    Resolved [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.

  2. #2
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    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:
    1. list1.additem format(Range("A1").value, "DD/mm/yyyy")
    CS

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    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.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    Resolved 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
  •  



Click Here to Expand Forum to Full Width