+ Reply to Thread
Results 1 to 6 of 6

Change Date and Time Format in Listview

  1. #1
    Registered User
    Join Date
    08-25-2021
    Location
    Kuching, Malaysia
    MS-Off Ver
    2016 32bits
    Posts
    30

    Post Change Date and Time Format in Listview

    Hi everyone,

    I need some help in formatting listview for date, downtime and uptime column.
    I wish to format Date column to dd/mm/yy and downtime & uptime column to hh:mm

    Any help would be appreciated, thank you in advance.
    Attached with is my excel file.
    Last edited by Cyril Beki; 09-14-2021 at 10:44 PM.

  2. #2
    Forum Expert
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    3,703

    Re: Change Date and Time Format in Listview

    give the code below a try

    Please Login or Register  to view this content.
    Torachan,

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

  3. #3
    Registered User
    Join Date
    08-25-2021
    Location
    Kuching, Malaysia
    MS-Off Ver
    2016 32bits
    Posts
    30

    Re: Change Date and Time Format in Listview

    Quote Originally Posted by torachan View Post
    give the code below a try

    Please Login or Register  to view this content.

    It seem like the code duplicate my data inside listview once i hit ADD button. As for the time format, it going back to general number after i close and open back the userform

  4. #4
    Forum Expert
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    3,703

    Re: Change Date and Time Format in Listview

    You are re-initializing your form at different points in your code - you only initialize a form once on the initial opening of the form.
    Remove the initialize calls and the formatting is then not overwritten, also you need a check on the add button as it can add rows of blank information.
    At the same time I will answer your second thread that you have opened on similar topic.
    You can not individually color single items in a listview/listbox.

  5. #5
    Registered User
    Join Date
    08-25-2021
    Location
    Kuching, Malaysia
    MS-Off Ver
    2016 32bits
    Posts
    30

    Re: Change Date and Time Format in Listview

    Sorry Mr. Torachan, i'm not understand, how can i do that ?

  6. #6
    Forum Expert
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    3,703

    Re: Change Date and Time Format in Listview

    I assume you are saying "how do I check my ADD button" use a code similar to the attached and loop through the controls to ensure data is present.

    Please Login or Register  to view this content.

+ 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. Replies: 6
    Last Post: 11-19-2020, 04:32 PM
  2. [SOLVED] Change time in text to date/time format with AM/PM converted to 24hr
    By iantix in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-14-2018, 06:13 AM
  3. [SOLVED] How to change date/time format from csv files
    By hammer2 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-13-2015, 12:07 AM
  4. Need vba code to change date&time stamp as date format dd-mmm-yy in A:A rng
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2014, 06:08 AM
  5. Why can I change my time zone but not my date format?
    By Kyle123 in forum Suggestions for Improvement
    Replies: 3
    Last Post: 10-26-2013, 03:06 PM
  6. Change system date and time format
    By elcaris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2008, 03:34 PM
  7. Replies: 3
    Last Post: 07-03-2005, 09:05 AM

Tags for this Thread

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