+ Reply to Thread
Results 1 to 2 of 2

I need to see if one shift start and finish time overlapps with another useing vba

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    2

    I need to see if one shift start and finish time overlapps with another useing vba

    HI
    Sorry about the spelling am dislexic

    I need to get some vba that will show me which shifts overlap
    as you can see on line one there is a overlpap btween the start time of one shift and the endtime of the next

    Date Type Start End Break Shift date Start Time End Time Shift type ?
    03-Nov-12 L 12:00:00 20:00:00 30 03/11/2012 07:30:00 12:30:00 Early Shift OverLap
    17-Nov-12 E 07:30:00 15:30:00 30 17/11/2012 15:30:00 20:00:00 Late Shift
    21-Nov-12 N 19:30:00 07:45:00 60 21/11/2012 07:30:00 20:00:00 Day Shift overlap
    26-Nov-12 E 07:30:00 15:30:00 30 26/11/2012 15:00:00 20:00:00 Late Shift OverLap

    any help would be great
    thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-21-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: I need to see if one shift start and finish time overlapps with another useing vba

    ' this is the best i have done sofar any help would be gtrat

    ActivityOneStartTime = Cells(ce1, 5)
    ActivityOneEndTime = Cells(ce1, 6)
    ActivityTwoStartTime = Cells(ce1, 18)
    ActivityTwoEndTime = Cells(ce1, 19)

    'ActivityOneStartTime = Range("B3").Value
    'ActivityOneEndTime = Range("c3").Value
    'ActivityTwoStartTime = Range("e3").Value
    'ActivityTwoEndTime = Range("f3").Value

    '--------------- Activity Two start time check ------------------

    If ActivityOneStartTime > ActivityTwoStartTime Then
    Cells(ce1, 22) = "overlap"
    ' ActiveCell.Interior.ColorIndex = 36

    End If

    If ActivityOneEndTime > ActivityTwoStartTime Then
    Cells(ce1, 22) = "overlap"
    ' ActiveCell.Interior.ColorIndex = 36
    End If

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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