The below code enters text into cells based on the number held by the variable named xtraboard. If xtraboard is one, it enters WED into A65; if xtraboard is two, it enters WED into A65 and THU into A66 etc. through xtraboard=30. The below works fine, but I am wondering if there is a better, more efficient way to do this.
Sub board(xtraboard)
Range("A65:A94").ClearContents
Range("A65").Select
If xtraboard = 1 Then
ActiveCell.Resize(1) = Application.Transpose(Array("WED"))
Else
If xtraboard = 2 Then
ActiveCell.Resize(2) = Application.Transpose(Array("WED", "THU"))
Else
If xtraboard = 3 Then
ActiveCell.Resize(3) = Application.Transpose(Array("WED", "THU", "SUN"))
Else
If xtraboard = 4 Then
ActiveCell.Resize(4) = Application.Transpose(Array("WED", "THU", "FRI", "SUN"))
Else
If xtraboard = 5 Then
ActiveCell.Resize(5) = Application.Transpose(Array("TUE", "WED", "THU", "FRI", "SUN"))
Else
If xtraboard = 6 Then
ActiveCell.Resize(6) = Application.Transpose(Array("TUE", "WED", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 7 Then
ActiveCell.Resize(7) = Application.Transpose(Array("TUE", "WED", "WED", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 8 Then
ActiveCell.Resize(8) = Application.Transpose(Array("TUE", "WED", "WED", "THU", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 9 Then
ActiveCell.Resize(9) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 10 Then
ActiveCell.Resize(10) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SUN"))
Else
If xtraboard = 11 Then
ActiveCell.Resize(11) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN"))
Else
If xtraboard = 12 Then
ActiveCell.Resize(12) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 13 Then
ActiveCell.Resize(13) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 14 Then
ActiveCell.Resize(14) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 15 Then
ActiveCell.Resize(15) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 16 Then
ActiveCell.Resize(16) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 17 Then
ActiveCell.Resize(17) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 18 Then
ActiveCell.Resize(18) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 19 Then
ActiveCell.Resize(19) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 20 Then
ActiveCell.Resize(20) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 21 Then
ActiveCell.Resize(21) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 22 Then
ActiveCell.Resize(22) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 23 Then
ActiveCell.Resize(23) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 24 Then
ActiveCell.Resize(24) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 25 Then
ActiveCell.Resize(25) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 26 Then
ActiveCell.Resize(26) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 27 Then
ActiveCell.Resize(27) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 28 Then
ActiveCell.Resize(28) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 29 Then
ActiveCell.Resize(29) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 30 Then
ActiveCell.Resize(30) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN", "SUN"))
End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If
End Sub
Sub board(xtraboard)
Range("A65:A94").ClearContents
Range("A65").Select
If xtraboard = 1 Then
ActiveCell.Resize(1) = Application.Transpose(Array("WED"))
Else
If xtraboard = 2 Then
ActiveCell.Resize(2) = Application.Transpose(Array("WED", "THU"))
Else
If xtraboard = 3 Then
ActiveCell.Resize(3) = Application.Transpose(Array("WED", "THU", "SUN"))
Else
If xtraboard = 4 Then
ActiveCell.Resize(4) = Application.Transpose(Array("WED", "THU", "FRI", "SUN"))
Else
If xtraboard = 5 Then
ActiveCell.Resize(5) = Application.Transpose(Array("TUE", "WED", "THU", "FRI", "SUN"))
Else
If xtraboard = 6 Then
ActiveCell.Resize(6) = Application.Transpose(Array("TUE", "WED", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 7 Then
ActiveCell.Resize(7) = Application.Transpose(Array("TUE", "WED", "WED", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 8 Then
ActiveCell.Resize(8) = Application.Transpose(Array("TUE", "WED", "WED", "THU", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 9 Then
ActiveCell.Resize(9) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "SAT", "SUN"))
Else
If xtraboard = 10 Then
ActiveCell.Resize(10) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SUN"))
Else
If xtraboard = 11 Then
ActiveCell.Resize(11) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN"))
Else
If xtraboard = 12 Then
ActiveCell.Resize(12) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 13 Then
ActiveCell.Resize(13) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 14 Then
ActiveCell.Resize(14) = Application.Transpose(Array("TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 15 Then
ActiveCell.Resize(15) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 16 Then
ActiveCell.Resize(16) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 17 Then
ActiveCell.Resize(17) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN"))
Else
If xtraboard = 18 Then
ActiveCell.Resize(18) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 19 Then
ActiveCell.Resize(19) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 20 Then
ActiveCell.Resize(20) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 21 Then
ActiveCell.Resize(21) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 22 Then
ActiveCell.Resize(22) = Application.Transpose(Array("TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 23 Then
ActiveCell.Resize(23) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN"))
Else
If xtraboard = 24 Then
ActiveCell.Resize(24) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 25 Then
ActiveCell.Resize(25) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 26 Then
ActiveCell.Resize(26) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 27 Then
ActiveCell.Resize(27) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 28 Then
ActiveCell.Resize(28) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 29 Then
ActiveCell.Resize(29) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN"))
Else
If xtraboard = 30 Then
ActiveCell.Resize(30) = Application.Transpose(Array("TUE", "TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "WED", "THU", "THU", "THU", "THU", "THU", "FRI", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "SAT", "SUN", "SUN", "SUN", "SUN", "SUN"))
End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If: End If
End Sub