![]() If (Weekday(StDateD) > 1) And (Weekday(StDateD) < 7) Then 'If the date is not a saterday or a sunday we add one day. This is to start the loop to get all the days between both dates. WorkDay2end = DateValue(EnDate) + TimeValue("17:00:00")Įnd If If DateDiff("n", TimeValue("08:00:00"), EnDateT, vbUseSystemDayOfWeek) > (5 * 60) Then WorkDay2Start = DateValue(EnDate) + TimeValue("08:00:00") WorkDay1end = DateValue(StDate) + TimeValue("17:00:00") WorkDay1Start = DateValue(StDate) + TimeValue("08:00:00") Public Function NetWorkHours(dteStart As Date, dteEnd As Date) As Integer Thanks!! Heres the code that Im trying to use. How would I go about making calculations so that the returned value will be the hours I worked while on the clock, and not a rolling 24-hour calculation? (While also skipping weekends if possible?) I start a project at 7AM on 11/14 and end it at 9AM on 11/16. For example, say my shift hours are 6AM-330PM. I'm wanting to create a system that can calculate the worked hours for a certain projects. I'm still getting the hang of more complex formulas in VBA. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |