M
Mike NG
Function WhichBox(piIndex As Integer) As Integer
If piIndex < 5 Then
WhichBox = 1
ElseIf piIndex < 9 Then
WhichBox = 2
ElseIf piIndex < 13 Then
WhichBox = 3
Else
WhichBox = 4
End If
End Function
I am going round in loops with / and mod - I am sure I can do it with
one line of code, but how do I do it please, i.e.
PiIndex Returns
1 to 4 1
5 to 8 2
9 to 12 3
13 to 16 4
If piIndex < 5 Then
WhichBox = 1
ElseIf piIndex < 9 Then
WhichBox = 2
ElseIf piIndex < 13 Then
WhichBox = 3
Else
WhichBox = 4
End If
End Function
I am going round in loops with / and mod - I am sure I can do it with
one line of code, but how do I do it please, i.e.
PiIndex Returns
1 to 4 1
5 to 8 2
9 to 12 3
13 to 16 4