trying by below steps can i get the code.. to get solve.
have 4 employees, so i have 4 x DateFrom and 4 x DateTo values to deal with.
step 1: get the input data.
create 2 arrays. eg. myDateFrom(1 to 4) and myDateTo(1 to 4) as date arrays, then read your dates into them
Step 2: Test for overlaps
You need to test each date to see if the start date of any employee is >= to the start date of any other, AND <= the end date of any other employee, and vice versa for the end date. Create a boolean variable to hold the results of the test (eg myFlag)
Step 3: Respond to a failed test
If either the start date or the end date are disqualified (myFlag = false), run a message box and force the selection of a new date. else run any msgbox you wish.
Sub MasterSub()
Call step1
Call step2
End Sub
Sub Step1()
some code goes here
End Sub
Sub Step2()
some code goes here
End Sub
Bookmarks