1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
| Sub test()
Dim Ws As Worksheet
Dim DerLig As Long
Range("C4:C" & Range("C64000").End(xlUp).Row).Copy
Range("L64000").End(xlUp)(4).PasteSpecial Paste:=xlPasteValues
' Colonne Matchs joués pour 1ère colonne
Formule = "=IF(RC[-8]="""",0,1)"
Sheets("Ronde N°1").Range("M4").Formula = Formule
Range("M4").Select
With Selection
.HorizontalAlignment = xlCenter
End With
Selection.AutoFill Destination:=Range("M4:M" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
' Colonne Matchs gagnés pour 1ère colonne
Formule = "=IF(RC[-9]=50,1,0)"
Sheets("Ronde N°1").Range("N4").Formula = Formule
Range("N4").Select
With Selection
.HorizontalAlignment = xlCenter
End With
Selection.AutoFill Destination:=Range("N4:N" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
' Colonne Matchs perdus pour 1ère colonne
Formule = "=IF(RC[-10]<>50,1,0)"
Sheets("Ronde N°1").Range("O4").Formula = Formule
Range("O4").Select
With Selection
.HorizontalAlignment = xlCenter
End With
Selection.AutoFill Destination:=Range("O4:O" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
' Colonne Pts pour 1ère colonne
Formule = "=RC[-11]"
Sheets("Ronde N°1").Range("P4").Formula = Formule
Range("P4").Select
With Selection
.HorizontalAlignment = xlCenter
End With
Selection.AutoFill Destination:=Range("P4:P" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
' Colonne Pts Adv. pour 1ère colonne
Formule = "=RC[-8]"
Sheets("Ronde N°1").Range("Q4").Formula = Formule
Range("Q4").Select
With Selection
.HorizontalAlignment = xlCenter
End With
Selection.AutoFill Destination:=Range("Q4:Q" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
' Colonne Différence pour 1ère colonne
Formule = "=RC[-13]-RC[-9]"
Sheets("Ronde N°1").Range("R4").Formula = Formule
Range("R4").Select
With Selection
.HorizontalAlignment = xlCenter
End With
Selection.AutoFill Destination:=Range("R4:R" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
Range("G4:G" & Range("G64000").End(xlUp).Row).Copy
Range("L64000").End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
' Colonne Matchs joués pour 2nde colonne
Formule = "=IF(R[-40]C[-4]="""",0,1)"
Sheets("Ronde N°1").Range("M65536").End(xlUp).Offset(1, 0).Select
With Selection
.Formula = Formule
.HorizontalAlignment = xlCenter
End With
'Selection.AutoFill Destination:=Range("M4:M" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
Set Ws = Sheets("Ronde N°1")
DerLig = Ws.Cells(Ws.Columns(13).Cells.Count, 13).End(xlUp).Row
With Ws
'Je détermine le numéro de la dernière ligne renseignée dans la colonne L
DerLigL = .Range("L" & .Rows.Count).End(xlUp).Row
'Je détermine le numéro de la dernière ligne renseignée dans la colonne M
DerLigM = .Range("M" & .Rows.Count).End(xlUp).Row
'J'effectue la recopie incrémentée dans la colonne M
.Range("M" & DerLigM).AutoFill Destination:=.Range(.Range("M" & DerLigM), .Range("M" & DerLigL))
End With
Range("K4").Select
ActiveCell.FormulaR1C1 = "1"
Range("K5").Select
ActiveCell.FormulaR1C1 = "2"
Range("K4:K5").Select
With Selection
.HorizontalAlignment = xlCenter
End With
Selection.AutoFill Destination:=Range("K4:K" & Range("L" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
Range("K3").Select
ActiveCell.FormulaR1C1 = "Classement"
Columns("L:L").ColumnWidth = 10
With Selection
.HorizontalAlignment = xlCenter
End With
Range("L3").Select
ActiveCell.FormulaR1C1 = "Nom Equipe"
Columns("L:L").ColumnWidth = 23
With Selection
.HorizontalAlignment = xlCenter
End With
Range("M3").Select
ActiveCell.FormulaR1C1 = "J"
Columns("M:M").ColumnWidth = 3
With Selection
.HorizontalAlignment = xlCenter
End With
Range("N3").Select
ActiveCell.FormulaR1C1 = "V"
Columns("N:N").ColumnWidth = 3
With Selection
.HorizontalAlignment = xlCenter
End With
Range("O3").Select
ActiveCell.FormulaR1C1 = "D"
Columns("O:O").ColumnWidth = 3
With Selection
.HorizontalAlignment = xlCenter
End With
Range("P3").Select
ActiveCell.FormulaR1C1 = "Pts"
Columns("P:P").ColumnWidth = 7
With Selection
.HorizontalAlignment = xlCenter
End With
Range("Q3").Select
ActiveCell.FormulaR1C1 = "Pts Adv"
Columns("Q:Q").ColumnWidth = 7
With Selection
.HorizontalAlignment = xlCenter
End With
Range("R3").Select
ActiveCell.FormulaR1C1 = "Différence"
Columns("R:R").ColumnWidth = 8
With Selection
.HorizontalAlignment = xlCenter
End With
Range("K2").Select
End Sub |
Partager