在『人員回報』這張資料表中「A」「B」「D」「E」「F」「G」欄位
希望能從『人力資料庫』這張資料表自動匯入人員資料
且自動排序, 排序方式為
1.班別:1ST,2ND,3RD,
2.領班:A,B,C.....
3.各領班的組別, 分別 V P K
範例:
班別/領班/組別
1ST A V
1ST A V
1ST A P
1ST A K
1ST B V
1ST B P
1ST B K
2ND A V
[attach]24870[/attach]
Case "V"
If Month(xDay) <= 6 And Weekday(xDay) = 7 Or Weekday(xDay) = 6 Then OverTime = True
If Month(xDay) > 6 And Weekday(xDay) = 1 Or Weekday(xDay) = 7 Then OverTime = True
Private Function OverTime(組別 As String) As Boolean
' <= 6 V組 六-休息日 / P組 日-休息日 / K組 二-休息日
' >6 V組 日-休息日 / P組 六-休息日 / K組 二-休息日
Select Case 組別
Case "V"
If Month(xDay) <= 6 And Weekday(xDay) = 7 Then OverTime = True
If Month(xDay) > 6 And Weekday(xDay) = 1 Then OverTime = True
Case "P"
If Month(xDay) <= 6 And Weekday(xDay) = 1 Then OverTime = True
If Month(xDay) > 6 And Weekday(xDay) = 7 Then OverTime = True