Displaying Normal Date formatb to a textbox instead of the searial value of the date

  • Hi im a noob when i comes to VBA and this is my first time to create a program. i have been beating my brains out for days now . I would like to ask if any of you knows how to make the textbox display the normal date format like dd/mm/yyyy coz every time i try to retrieve the whole worksheet all the textbox for my date displays serial values like 30698 ( 01/17/1984). I have done the format cell still the same result. and when i press CTL~
    it shows that my date columns are in serial value. is there a code that can help display the right date format? or do i need to tweek something in my excel worksheet to change it? thank you in advance.
    [ATTACH=CONFIG]68875[/ATTACH]

  • Re: Displaying Normal Date formatb to a textbox instead of the searial value of the d


    hi sktneer
    this is the code i used in retrieving my datas


  • Re: Displaying Normal Date formatb to a textbox instead of the searial value of the d


    A sample workbook would be helpful to see what controls you have on the userform and how you are transferring the values from the sheet into the controls or from userform into the sheet.

    Regards.
    sktneer

  • Re: Displaying Normal Date formatb to a textbox instead of the searial value of the d


    oh my gosh it worked!! thank u so so so much Pike and thank you too sktneer u guys are awesome ^^

  • Re: Displaying Normal Date formatb to a textbox instead of the searial value of the d


    Another way to populate the TextBox with the date is as below....


    Code
    Me.tbdob.Value = CDate(Me.lstSearch.Column(8, i))

    Regards.
    sktneer

  • Re: Displaying Normal Date formatb to a textbox instead of the searial value of the d


    Yes you are correct. Good point.
    Actually CDate will adopt the date format as per the system's date setting so if the format is set to m/d/yyyy in regional settings, CDate will also display the date in that format.
    It will not work if you specifically want the date to display in the d/m/yyy yformat.

    Regards.
    sktneer

  • Re: Displaying Normal Date formatb to a textbox instead of the searial value of the d


    wow i learned something new thank u guys i would definitely take note of that

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!