muhleebbin
Active Member
- Joined
- Sep 30, 2017
- Messages
- 252
- Office Version
- 365
- 2019
- 2016
- 2013
- 2010
- Platform
- Windows
- MacOS
- Mobile
- Web
Could someone assist me in producing some VBA code that could find overlapping time on a timesheet workbook my software produces?
Current VBA gets me to this point:
But as you can see on 1 - Test for 10/26/20 there is a duplicate entry. Could VBA code find overlapping time over each individual date for each employee? This sample data above only shows two employees but there are over 40 employees in the real data set.
Current VBA gets me to this point:
SUBMITTED TIME REPORT -- 10262020 - Mon - 11012020 - Sun.xlsm | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | |||
1 | Date | Job | Time In | Time Out | Cost Code | Hours | Earn Code | Phase | sort | |||||||||||||
2 | 1 - Test | Subtotal Hours : 44.25 | 1 | |||||||||||||||||||
3 | 10/26/2020 | 958 - Test | 1 - Test | 8:00 AM | 10:00 AM | 1503 - Gaging & rodding | - | 2 | REG | $0.00 | Test | - | - | Test | - | - | 101 - Exterior Entry Way | Pending | 11/03/2020 4:52 pm UTC | 1.1 | ||
4 | 10/26/2020 | 958 - Test | 1 - Test | 10:00 AM | 4:00 PM | 200 - Floor - Tile | - | 6 | REG | $0.00 | Test | - | - | Test | - | - | 101 - Exterior Entry Way | Pending | 11/03/2020 4:53 pm UTC | 1.1 | ||
5 | 10/26/2020 | 958 - Test | 1 - Test | 10:00 AM | 4:00 PM | 200 - Floor - Tile | - | 6 | REG | $0.00 | Test | - | - | Test | - | - | 101 - Exterior Entry Way | Pending | 11/03/2020 4:54 pm UTC | 1.1 | ||
6 | 10/27/2020 | 958 - Test | 1 - Test | 8:30 AM | 5:00 PM | 200 - Floor - Tile | - | 8.5 | REG | $0.00 | Test | - | - | Test | - | - | 101 - Exterior Entry Way | Pending | 11/03/2020 4:56 pm UTC | 1.1 | ||
7 | 10/28/2020 | 958 - Test | 1 - Test | 8:00 AM | 11:30 AM | 200 - Floor - Tile | - | 3.5 | REG | $0.00 | Test | - | - | Test | - | - | 101 - Exterior Entry Way | Pending | 11/03/2020 4:57 pm UTC | 1.1 | ||
8 | 10/28/2020 | 632 - Test2 | 1 - Test | 11:30 AM | 3:15 PM | 220 - Backsplash - Tile | - | 3.75 | REG | $0.00 | Test | - | - | Test | - | - | 109 - Kitchen | Pending | 11/03/2020 5:03 pm UTC | 1.1 | ||
9 | 10/29/2020 | 632 - Test2 | 1 - Test | 7:00 AM | 2:30 PM | 220 - Backsplash - Tile | - | 7.5 | REG | $0.00 | Test | - | - | Test | - | - | 109 - Kitchen | Pending | 11/03/2020 5:05 pm UTC | 1.1 | ||
10 | 10/30/2020 | 632 - Test2 | 1 - Test | 7:30 AM | 2:30 PM | 220 - Backsplash - Tile | - | 7 | REG | $0.00 | Test | - | - | Test | - | - | 108 - Media Room Kitchen | Pending | 11/03/2020 5:07 pm UTC | 1.1 | ||
11 | 44.25 | |||||||||||||||||||||
12 | 4.25 | |||||||||||||||||||||
13 | 3 - Test 3 | Subtotal Hours : 40 | 3 | |||||||||||||||||||
14 | 10/26/2020 | 957 - Test4 | 3 - Test 3 | 7:00 AM | 3:00 PM | 1513 - Pedestal set Pavers | - | 8 | REG | $0.00 | Test | - | - | Test6 | - | - | 105 - Deck Pavers | Pending | 10/28/2020 12:17 am UTC | 3.1 | ||
15 | 10/27/2020 | 957 - Test4 | 3 - Test 3 | 7:00 AM | 3:00 PM | 1513 - Pedestal set Pavers | - | 8 | REG | $0.00 | Test | - | - | Test6 | - | - | 105 - Deck Pavers | Pending | 10/28/2020 12:18 am UTC | 3.1 | ||
16 | 10/28/2020 | 957 - Test4 | 3 - Test 3 | 7:00 AM | 3:00 PM | 1513 - Pedestal set Pavers | - | 8 | REG | $0.00 | Test | - | - | Test6 | - | - | 105 - Deck Pavers | Pending | 10/30/2020 1:43 pm UTC | 3.1 | ||
17 | 10/29/2020 | 957 - Test4 | 3 - Test 3 | 7:00 AM | 3:00 PM | 1513 - Pedestal set Pavers | - | 8 | REG | $0.00 | Test | - | - | Test6 | - | - | 105 - Deck Pavers | Pending | 10/30/2020 1:44 pm UTC | 3.1 | ||
18 | 10/30/2020 | 957 - Test4 | 3 - Test 3 | 7:00 AM | 3:00 PM | 1513 - Pedestal set Pavers | - | 8 | REG | $0.00 | Test | - | - | Test6 | - | - | 105 - Deck Pavers | Pending | 10/31/2020 2:19 pm UTC | 3.1 | ||
19 | 40 | |||||||||||||||||||||
20 | 0 | |||||||||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H11 | H11 | =SUM($H$3:$H$10) |
H12 | H12 | =IF(H11>40,IF((H11-SUMIF($F$3:$F$10,"*PTO*",$H$3:$H$10)-SUMIF($F$3:$F$10,"*Holiday*",$H$3:$H$10)>40),H11-SUMIF($F$3:$F$10,"*PTO*",$H$3:$H$10)-SUMIF($F$3:$F$10,"*Holiday*",$H$3:$H$10)-40,0),0) |
H19 | H19 | =SUM($H$14:$H$18) |
H20 | H20 | =IF(H19>40,IF((H19-SUMIF($F$14:$F$18,"*PTO*",$H$14:$H$18)-SUMIF($F$14:$F$18,"*Holiday*",$H$14:$H$18)>40),H19-SUMIF($F$14:$F$18,"*PTO*",$H$14:$H$18)-SUMIF($F$14:$F$18,"*Holiday*",$H$14:$H$18)-40,0),0) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
C14:C18 | Cell Value | contains "1 - General Costs" | text | NO |
D14 | Cell Value | contains "1 - General Costs" | text | NO |
F1,E376:E1048576,F375,F359:F370,E2:E358 | Cell Value | contains "1 - General Costs" | text | NO |
But as you can see on 1 - Test for 10/26/20 there is a duplicate entry. Could VBA code find overlapping time over each individual date for each employee? This sample data above only shows two employees but there are over 40 employees in the real data set.