+ Reply to Thread
Results 1 to 3 of 3

Time format without the Date part formula to VBA solution for entire column

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Time format without the Date part formula to VBA solution for entire column

    Please see attached workbook.
    In column A I have Times. However when you put your cursor on A2 you will see there is also a date part that is not showing.
    But because of that I cannot calculate between times with that cell.

    Now on another part of this site I already got a formula solution for this.
    You will find it in B2 (MOD(A2;1)).
    As you can see in B3 that works just fine.

    Now I could use VBA to fill an extra column with this formula.
    But as there already are a lot of columns I was looking for a solution that converts the column in place.
    This is only a sample the entire list if about 6000 rows (so could be performance problems for some solutions)

    Hope there is an elegant solution. I heard VBA has also a MOD function but I cannot get it to work.

    ps: orgininally the column is column L (for the VBA code that would matter I guess if the code not explicitly refers to a column letter)
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Time format without the Date part formula to VBA solution for entire column

    Here's one macro that you could use

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Re: Time format without the Date part formula to VBA solution for entire column

    Superb Richard
    You used INT (was a second solution I got indeed. Int and Mod)
    Just had to use For x = 2 to lRow because I have headers.

    Work like a charm. Thank you very much.

+ 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] How to convert Date and time format to only date in Column
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-29-2018, 08:28 AM
  2. Not able to get entire column not just part.
    By sattlet999 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2015, 05:41 PM
  3. [SOLVED] Splitting date fails for a part of date column due to different cell format
    By Moriexcel in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 11-21-2014, 01:00 PM
  4. [SOLVED] Format entire column to date
    By tvraddy05 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-28-2012, 11:15 AM
  5. [SOLVED] Excel 2007 : Format entire columns based on date at head of column
    By CakeBloke in forum Excel General
    Replies: 2
    Last Post: 06-07-2012, 07:44 AM
  6. How to apply a proper date format to an entire column?
    By anb001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-03-2008, 03:47 PM
  7. solution Time Format Question
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 07:05 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