Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Aug 2006
    Location
    Bromley, Kent, England
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    UK date format (VBA 2003)

    I have a form with a text box where the user must input a date. I want the user to be able to input UK format i.e. dd/mm/yyyy but VBA "thinks" I'm inputting in US format i.e. if I input 02/04/2006 it will come out on the spreadsheet as 04/02/2006. The regional settings are all UK and the format on the spreadsheet is dd/mm/yyyy.
    Does anyone know what's going wrong?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: UK date format (VBA 2003)

    Welcome to Woody's Lounge!

    If you set the ControlSource property of the text box to a cell address, the "translation" should be OK. If you use code to transfer the text box value to a cell, try using the CDate function:

    Range("A1") = CDate(Me.TextBox1)

  3. #3
    New Lounger
    Join Date
    Aug 2006
    Location
    Bromley, Kent, England
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: UK date format (VBA 2003)

    The CDate thing worked, thanks very much <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •