Function BlockTop(IJ) As Integer If IJ <= 3 Then BlockTop = 1 ElseIf IJ <= 6 Then BlockTop = 4 Else BlockTop = 7 End If End Function