I am using Nested For Loop in a Macro to split each day in three durations (N.Peak from 00:00 to 11:00 hrs, Peak from 11:00 to 23:00 hrs, and N.Peak from 23:00 to 24:00 hrs), with the exception that Sunday has only one duration ( From Start time to End time if Given, or from 00:00 to 24:00 hrs if it comes in between two dates as full day)
I have large Number of such days and this macro is generating correct durations for each day other than Sunday.
For Sunday it is Generating duration from Start time to End time , and also from 00:00 to 24:00 hrs ( As a Full Day , which is not required )
following is the code. Can anyone correct it for me. I have also attached Excel Sheet with the Sample data and Macro
Nested For Loop.xlsm
Bookmarks