+ Reply to Thread
Results 1 to 13 of 13

problem format date in listbox

  1. #1
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    problem format date in listbox

    hello
    I need help fixing date in column 1 in listbox based on column a in sheet 1 it shows value when I write in textbox1 the names , so I want showing like this dd/mm/yyyy
    thanks in advance
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: problem format date in listbox

    Hi,

    put this in the userform_initialize part

    Please Login or Register  to view this content.
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

  3. #3
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: problem format date in listbox

    hi, Joske , unfortunately nothing changes

  4. #4
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: problem format date in listbox

    I have read your sentence multiple times and I don't know what i can make of it but the thing I added

    You need help fixing the date in column 1 in listbox

    first the date was shown as 1/1/2020 and now its shown as 01/01/2020

    it does what you asked.. what do you mean??

  5. #5
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: problem format date in listbox

    the problem is not when I run userform it's ok show date as what I want dd/mm/yyyy but when I write in textbox the name based on column b in sheet1 the date in listbox becomes values like 435466 , if you test the form you understand what I mean

  6. #6
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: problem format date in listbox

    Something like this.
    Please Login or Register  to view this content.
    Best Regards,
    Maras.

  7. #7
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: problem format date in listbox

    hi, maras the problem is not in event UserForm_Initialize() also joske's code works the problem in textbox1 when I write into textbox it changes to date value like this 43831 not as your code dd-mm-yyyy

  8. #8
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: problem format date in listbox

    @ABDELFATTA

    When you use some vba commands/properties => 'Value2' =>, learn (in the contextual help) about their specific operation in certain situations:

    "The only difference between this property and the Value property is that the Value2 property doesn’t use the Currency and Date data types. You can return values formatted with these data types as floating-point numbers by using the Double data type"

  9. #9
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: problem format date in listbox

    again all of codes for guys work in one case if I run the form every thing is ok but when I search specific name in textbox it changes to date value I think the modifying supposes in texebox1 change event but how I no know so far I tried many of tries but nothing success

  10. #10
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: problem format date in listbox

    it shows the date correct for me...

    Attachment 708517

  11. #11
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: problem format date in listbox

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: problem format date in listbox

    thanks Porucha I'm really sorry because I don't take your notice seriously actually I don't see value 2 where is existed because this code not mine , you're absolutely right , now it works
    thanks for all guys

  13. #13
    Registered User
    Join Date
    07-07-2020
    Location
    Israel
    MS-Off Ver
    microsoft 365
    Posts
    1

    Re: problem format date in listbox

    I had the problem that part of added items in a listbox were in the correct European (dd/mm/yyyy) and part were in the American (mm/dd/yyyy) format. The source cells were correct formatted as date, tried to solve the problem with CDate and with formatting the item when populating the listbox. Nothing helped. This has been driving me nuts - until I found this answer of yours: Value2. Thanks an awful lot!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Userform listbox date format setting
    By carlrubber in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-19-2018, 02:25 AM
  2. [SOLVED] Useform Listbox Date Format
    By nancyching1711 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2018, 11:35 AM
  3. [SOLVED] Date format in row source for userform listbox
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-23-2015, 02:46 PM
  4. [SOLVED] date format changes from listbox and textbox on same sheet
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-04-2013, 03:00 PM
  5. Chnage format of Date in Listbox
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2012, 10:24 AM
  6. Format date in ListBox on Userform
    By LiamPotter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2009, 09:08 AM
  7. ListBox date format
    By brainfreez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2008, 05:29 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1