+ Reply to Thread
Results 1 to 5 of 5

TextBox and ListBox Date time Issue

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

    TextBox and ListBox Date time Issue

    Copy Record.xlsb

    I have a excel userform with data field loan and return date time (textbox 7 & 8).
    how can I show the field in textbox and listbox with both date and time as shown in "data" sheet col. H & I, i just can show the date only right now

    please help

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: TextBox and ListBox Date time Issue

    Add the code below to format your textboxes (you may need to change the format to your locale settings)

    Please Login or Register  to view this content.

    Add the following five rows to CommandButton9 and also to the Initialize event immediately following the listbox load and to any other Sub that you use to load the listbox.
    Please Login or Register  to view this content.
    please place all your declared variables immediately after Option Explicit - then run debug and correct all the errors that show.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

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

    Re: TextBox and ListBox Date time Issue

    thz for your help.

    but how about the listbox? it still no time inside listbox

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: TextBox and ListBox Date time Issue

    Get rid of your UserForm_Activate event it is overriding the Initialize events and cancelling out the format.
    Get rid if your present CommandButton9_Click event and Your Initialize event - then copy/paste the code below - one Sub LOADLIST() is called from the initialize and also if you click Command9


    Please Login or Register  to view this content.

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

    Re: TextBox and ListBox Date time Issue

    thz so much it ok now
    you are great

+ 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. Run-Time Error 380 in code to search for a word in Listbox through a textbox on Userform
    By Arif N. Khan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2023, 01:07 AM
  2. Replies: 7
    Last Post: 11-18-2020, 11:29 AM
  3. [SOLVED] Issue with search and display result on ListBox as you type on a TextBox
    By rakotonirinas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-31-2019, 07:15 AM
  4. VBA - Userform - Listbox validation and Listbox to Textbox
    By stevefisher85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2016, 07:11 AM
  5. [SOLVED] Compile error with coding for date in textbox......2007 to 2010 issue!!!
    By Bflare in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-28-2014, 08:20 AM
  6. Not showing value time in TextBox and ListBox
    By Seeuw in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-14-2013, 06:27 AM
  7. [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

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