Sub maj()

Dim i, place As Integer
i = 4

If IsNumeric(Cells(3, 2).Value) = True Then

place = chercher_place(Cells(3, 2).Value)

Else: MsgBox "entrer un numéro"
Exit Sub
End If


If place = 0 Then
MsgBox "numero non valide"
Exit Sub
End If
i = 2


While i <= 6
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(34, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 11
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(35, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 16
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(38, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 21
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(39, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 26
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(40, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 31
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(41, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 36
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(44, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend


While i <= 41
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(45, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 46
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(46, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 51
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(47, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 56
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(48, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 61
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(51, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 66
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(52, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 71
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(53, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 76
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(56, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 81
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(57, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 86
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(58, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 91
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(60, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 96
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(62, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 101
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(63, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 106
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(67, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 111
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(68, 5).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

Sheets("01").Cells(34, 9).Value = Sheets("5.1").Cells(place, 115).Value

i = 116

While i <= 119
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(35, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 124
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(38, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 129
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(39, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 134
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(40, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 139
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(41, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

i = 142
While i <= 146
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(44, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 151
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(45, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 153
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(48, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

i = 155

While i <= 157
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(49, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend


While i <= 160
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(50, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend


While i <= 163
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(51, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 168
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(54, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 173
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(55, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 178
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(57, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

While i <= 183
If Sheets("5.1").Cells(place, i).Value = "X" Then
Sheets("01").Cells(58, 9).Value = Sheets("5.1").Cells(3, i).Value
End If
i = i + 1
Wend

End Sub

Function chercher_place(ByVal num As Integer) As Integer

Dim i As Integer
i = 3

While i <= Sheets("5.1").Range("a65536").End(xlUp).Row
i = i + 1

If Sheets("5.1").Cells(i, 1).Value = Sheets("01").Cells(3, 2).Value Then
chercher_place = i
End If

Wend

End Function

