Ok i am trying to create a excel form that does a schedule. this form has a time in and timout that i want to auto calculate based off of the other data.
the person will add a 1 to each hr the employee will work. If it start at 8 than the time in is auto filled and in this example I want the time out to state 12 pm.
the way i was trying to write the code to do this made it to large and I am not even half way done for each employee in the list. we have about 25 employees.
This form will be used in large work book and the person using this form like looking at this type of format I am trying to get some of this data to auto fill for him.
example of my code per employee:
the person will add a 1 to each hr the employee will work. If it start at 8 than the time in is auto filled and in this example I want the time out to state 12 pm.
the way i was trying to write the code to do this made it to large and I am not even half way done for each employee in the list. we have about 25 employees.
This form will be used in large work book and the person using this form like looking at this type of format I am trying to get some of this data to auto fill for him.
example of my code per employee:
Code:
' Calculating the Time in emploee ID 1001
If Range("E9") = "" And Range("F9") = "" And Range("G9") = "" And Range("H9") = "" And Range("I9") = "" And Range("J9") = "" And Range("K9") = "" And Range("L9") = "" And Range("M9") = "" And Range("N9") = "" And Range("O9") = "" And Range("P9") = "" And Range("Q9") = "" And Range("R9") = "" And Range("S9") = "" Then
Range("C9") = ("Off")
End If
If Range("E9") = 1 Then
Range("c9") = ("8:00")
End If
If Range("F9") = 1 And Range("E9") = "" Then
Range("c9") = ("9:00")
End If
If Range("G9") = 1 And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("10:00")
End If
If Range("H9") = 1 And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("11:00")
End If
If Range("I9") = 1 And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("12:00")
End If
If Range("J9") = 1 And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("1:00 pm")
End If
If Range("K9") = 1 And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("2:00 pm")
End If
If Range("L9") = 1 And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("3:00 pm")
End If
If Range("M9") = 1 And Range("L9") = "" And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("4:00 pm")
End If
If Range("N9") = 1 And Range("M9") = "" And Range("L9") = "" And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("5:00 pm")
End If
If Range("O9") = 1 And Range("N9") = "" And Range("M9") = "" And Range("L9") = "" And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("6:00 pm")
End If
If Range("P9") = 1 And Range("O9") = "" And Range("N9") = "" And Range("M9") = "" And Range("L9") = "" And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("7:00 pm")
End If
If Range("Q9") = 1 And Range("P9") = "" And Range("O9") = "" And Range("N9") = "" And Range("M9") = "" And Range("L9") = "" And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("8:00 pm")
End If
If Range("R9") = 1 And Range("Q9") = "" And Range("P9") = "" And Range("O9") = "" And Range("N9") = "" And Range("M9") = "" And Range("L9") = "" And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("9:00 pm")
End If
If Range("S9") = 1 And Range("R9") = "" And Range("Q9") = "" And Range("P9") = "" And Range("O9") = "" And Range("N9") = "" And Range("M9") = "" And Range("L9") = "" And Range("K9") = "" And Range("J9") = "" And Range("I9") = "" And Range("H9") = "" And Range("G9") = "" And Range("F9") = "" And Range("E9") = "" Then
Range("c9") = ("10:00 pm")
End If