essayes ce code, excuses-moi, j'ai appelé ta fonction pg pour ne pas détruire l'autre
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 Function pg(ByVal n As Integer) As Single Dim i As Integer, x As Integer For i = 14 To 19 If IsNumeric(Cells(i, 1).Value) And Cells(i, 1).Value <= n Then pg = Cells(i, 1).Value x = i Exit For End If Next i if x < 19 then For i = x + 1 To 19 If IsNumeric(Cells(i, 1).Value) And Cells(i, 1).Value <= n Then If Cells(i, 1).Value > pg Then pg = Cells(i, 1).Value End If End If Next i end if End Function