+ Reply to Thread
Results 1 to 5 of 5

Userform listbox formatting on the fields of date

  1. #1
    Registered User
    Join Date
    01-20-2015
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    36

    Userform listbox formatting on the fields of date

    Would anyone help for formatting the userform listbox on the fields of date (Employment, First Completion, Last Review, Due and target completion, actually some calculation are behind) such that showing dd/mm/yyyy? even i force the input textbox in format of dd/mm/yyyy, it shown in the listbox again in the format of yyyy/mm/dd…? other than inputbox, I m happy on adding calendar form besides?
    And how could i fix the first row about the column header in the listbox?
    thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Userform listbox formatting on the fields of date

    Hi carlrubber,

    The following code snippet should help you format your dates any way you want:
    Please Login or Register  to view this content.
    And how could i fix the first row about the column header in the listbox?
    I do not understand this question. The ListBox header looks OK to me.

    ---------------------
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    I hope this helps.

    Lewis

  3. #3
    Registered User
    Join Date
    01-20-2015
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    36

    Re: Userform listbox formatting on the fields of date

    Thz for your reply. but i insert the code you suggested and i add an entry from blank form, the result shown in listbox do not as expected as dd/mm/yyyy………
    for the second qs, if I have entry more than the listbox show, the first row will disappear when i scroll down…..
    again thz in advance

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Userform listbox formatting on the fields of date

    You seem to have duplication of effort. Try removing the lines below from UserForm_Activate():
    Please Login or Register  to view this content.
    If you have additional problems, please upload a new file, and indicate the exact keystrokes required to demonstrate your problem.

  5. #5
    Registered User
    Join Date
    01-20-2015
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    36

    Re: Userform listbox formatting on the fields of date

    but it still in format dd/mm/yyyy please....

+ 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. [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
  2. [SOLVED] if anything in listbox select first item, if listbox empty do nothing (listbox in userform
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 12:49 PM
  3. Populating listbox values of userform dynamically in the Access table fields
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-07-2014, 06:52 AM
  4. Replies: 2
    Last Post: 09-19-2013, 10:34 AM
  5. Transfer Data From One Userform Listbox to Another Userform Listbox with 11 columns
    By sparkoft in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2013, 10:54 AM
  6. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  7. Format date in ListBox on Userform
    By LiamPotter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2009, 09:08 AM

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