-
Hi all,
Just want to get some different ideas as to how to write this algorithm. I wrote it already, but it seems pretty long and I would like it shorter if possible. Here goes. I have ten people on a team. They are split into two groups of 5 (0-4,5-9). Each person in the group alternates being on call for the week. The call schedule is as follows:
MT***SS
0123400
5678955
1234011
6789566
2340122
7895677
3401233
8956788
4012344
9567899
0123400
.
.
.
Thanks in advance for any ideas/help!!!
-
Hope my sample code can give you a better solution...
Code:
Option Explicit
Private Const TEAM1 = "01234"
Private Const TEAM2 = "56789"
Private Const TEAM_MEMBER = 5
Private Sub Command1_Click()
Dim dCnt As Integer
Debug.Print "MT***SS"
For dCnt = 1 To 5
Debug.Print Mid(TEAM1, dCnt, TEAM_MEMBER - (dCnt - 1)) & Left(TEAM1, dCnt - 1) & Mid(TEAM1, dCnt, 1) & Mid(TEAM1, dCnt, 1)
Debug.Print Mid(TEAM2, dCnt, TEAM_MEMBER - (dCnt - 1)) & Left(TEAM2, dCnt - 1) & Mid(TEAM2, dCnt, 1) & Mid(TEAM2, dCnt, 1)
Next
End Sub
-
Works great!! Thanks a lot.
I had mine in two for loops, but yours is much more compact.