New Member
May 3, 2019
Sub Print_Ready()
Dim TOTLIN
TOTLIN = 1
WREC = 1
RAC = 0
Range("BW2:BW165").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("I2:I165").Select
Selection.Font.Bold = True
10 RAC = RAC + 1
11 If PP(RAC) = 0 Then GoTo 10 Else GoTo 20
20 WREC = WREC + PP(RAC)
Range(Cells(WREC, 1), Cells(WREC, 75)).Select
Selection.Borders(xlLeft).LineStyle = xlNone
Selection.Borders(xlRight).LineStyle = xlNone
Selection.Borders(xlTop).LineStyle = xlNone
With Selection.Borders(xlBottom)
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.BorderAround LineStyle:=xlNone
Range(Cells((WREC + 1 - PP(RAC)), 3), Cells(WREC, 75)).Select
Selection.Sort Key1:=Range("I:I"), Order1:=xlDescending, HEADER:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom
If RAC = RAM Then GoTo 30 Else GoTo 10
30 WREC = 1
RAC = 0
39 If RAC = RAM Then GoTo 200 Else GoTo 40
40 RAC = RAC + 1
41 If PP(RAC) = 0 Then GoTo 40 Else GoTo 50
50 TOTLIN = TOTLIN + PP(RAC)
If TOTLIN < 44 Then GoTo 39 Else GoTo 60
60 If TOTLIN = 44 Then GoTo 70 Else GoTo 62
'page 1 has part of a race : subtract last race and shift for spaces to fill page
62 TOTLIN = TOTLIN - PP(RAC)
RAC = RAC - 1
65 Range(Cells((TOTLIN + 1), 1), Cells((TOTLIN + 1), 75)).Select
Selection.Insert Shift:=xlDown
TOTLIN = TOTLIN + 1
If TOTLIN = 44 Then GoTo 69 Else GoTo 65
69 If RAC = RAM Then GoTo 200 Else GoTo 70
'Beginning page 2
70 RAC = RAC + 1
71 If PP(RAC) = 0 Then GoTo 72 Else GoTo 80
72 RAC = RAC + 1
80 TOTLIN = TOTLIN + PP(RAC)
If TOTLIN < 90 Then GoTo 69 Else GoTo 90
90 If TOTLIN = 90 Then GoTo 110 Else GoTo 92
'beginning page 3
92 TOTLIN = TOTLIN - PP(RAC)
RAC = RAC - 1
95 Range(Cells((TOTLIN + 1), 1), Cells((TOTLIN + 1), 75)).Select
Selection.Insert Shift:=xlDown
TOTLIN = TOTLIN + 1
If TOTLIN = 90 Then GoTo 110 Else GoTo 95
110 If RAC = RAM Then GoTo 200 Else GoTo 111
111 RAC = RAC + 1
112 If PP(RAC) = 0 Then GoTo 113 Else GoTo 120
113 RAC = RAC + 1
120 TOTLIN = TOTLIN + PP(RAC)
If TOTLIN < 136 Then GoTo 110 Else GoTo 140
140 If TOTLIN = 136 Then GoTo 200 Else GoTo 142
142 TOTLIN = TOTLIN - PP(RAC)
RAC = RAC - 1
145 Range(Cells((TOTLIN + 1), 1), Cells((TOTLIN + 1), 75)).Select
Selection.Insert Shift:=xlDown
TOTLIN = TOTLIN + 1
If TOTLIN = 136 Then GoTo 200 Else GoTo 145
200 Columns("AQ:AQ").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Columns("AX:AX").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Columns("R:R").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
ActiveWindow.SmallScroll ToRight:=6
Columns("V:V").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Columns("Z:Z").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Columns("AD:AD").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Columns("AH:AH").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Columns("AM:AM").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Columns("BD:BD").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
ActiveWindow.SmallScroll ToRight:=-6
Columns("F:F").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End Sub
1 Guest(s)