+ Reply to Thread
Results 1 to 3 of 3

Determine difference in time

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    San Francisco, CA
    MS-Off Ver
    2013
    Posts
    24

    Determine difference in time

    Hello,
    I’m using VBA to run a code for an excel spreadsheet. My spreadsheet has four columns (DATE, TIME, USER, ACTION) and about 400 rows.

    I’d like my code to determine if there was less than 4 minutes between actions for a user. If it determines that this is true, then all of the text in the “older time” in those 4 columns making up that row should change to red.

    EXAMPLE:
    (1) 9/30/14 21:56 32 IN
    (2) 9/29/14 20:45 28 IN
    (3) 9/29/14 20:44 28 IN
    (4) 9/28/14 19:12 31 IN
    (5) 9/28/14 19:10 27 IN
    (6) 9/27/14 12:36 28 IN
    (7) 9/26/14 12:34 28 IN

    -Row 3 should change to red text in that row because the time difference is less than 4 minutes and it is the same user (#28) and it is the ‘older’ time

    -Row 5 does not change to red text – even though the time difference is less than 4 minutes, they are not the same user

    -Row 7 does not change to red text – even though the time difference is less than 4 minutes, and it is the same user, the action occurred on a different day

    Any help and shared expertise would be greatly appreciated! Thank you!

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

    Re: Determine difference in time

    Hi lacke81c and welcome to ExcelForum,

    When I tested the following macro, the data started in cell "A1" (date).
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Registered User
    Join Date
    09-11-2014
    Location
    San Francisco, CA
    MS-Off Ver
    2013
    Posts
    24

    Re: Determine difference in time

    Thank you LJMetzger !

    It is working perfectly

+ 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. formula to determine what time double time starts and ends after 16:30
    By cfinch100 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-22-2013, 12:05 PM
  2. Replies: 21
    Last Post: 11-30-2012, 07:28 PM
  3. Replies: 3
    Last Post: 01-24-2011, 12:48 PM
  4. [SOLVED] Can you compare similar spreadsheets to determine a difference?
    By DLopez79 in forum Excel General
    Replies: 1
    Last Post: 01-09-2006, 05:40 PM
  5. How to determine difference?
    By Fionavar in forum Excel General
    Replies: 7
    Last Post: 01-21-2005, 01:06 PM

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