Sub xx()
'juste pour remplir la colonne avec un x au hazard
[A1:A80000] = "a"
Randomize
Cells(Round(1 + (Rnd * 79999)), 1) = "x"
End Sub
Sub ChecheX()
Dim pioche As Boolean, i&, e&, maligne&, segment, t#, Chaine
tbl = [A1].Resize(ActiveSheet.UsedRange.Rows.Count, 1).Value
partie = UBound(tbl) / 10
Chaine = "x"
t = Timer
For i = UBound(tbl) To 1 Step -partie
deb = Application.Max(1, i - partie)
If Application.CountIf(Range(Cells(i, 1), Cells(deb, 1)), Chaine) Then
segment = Range(Cells(i, 1), Cells(deb, 1)).Address(0, 0)
pioche = True
For e = i To i - partie Step -1
If tbl(e, 1) = Chaine Then maligne = e: Exit For
Next
End If
If pioche Then Exit For
Next
MsgBox "x trouvé en ligne " & maligne & " dans le segment " & segment & vbCrLf & "en " & Format(Timer - t, "#0.000 sec")
End Sub