Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long, numero As Long
If Not Intersect(Target, Columns(2)) Is Nothing Then
Application.EnableEvents = False
numero = 1
Columns(1).ClearContents
For i = 1 To ActiveSheet.Range("B" & ActiveSheet.Rows.Count).End(xlUp).Row
If ActiveSheet.Range("B" & i) = "X" Then
ActiveSheet.Range("A" & i) = numero
numero = numero + 1
End If
Next i
Application.EnableEvents = True
End If
End Sub