Bonjour toutes et tous,
La macro suivante fonctionne sans plantage :
Private Sub Worksheet_Activate()
Set p = Sheets('Historique').Range('A2:A65000')
For Each c In p
If c = '' Then Exit Sub
pont = c
GoSub suite
Next c
Exit Sub
suite:
Set n = Sheets('Historique').Range('A2').CurrentRegion
For Each x In n
If pont = x Then
If x.Next.Next.Formula = 'Out of Use' Then
Sheets('statut').Range('B_' & pont).Interior.ColorIndex = 3
End If
End If
Next x
Return
End Sub
Mais dans les lignes
If x.Next.Next.Formula = 'Out of Use' Then
Sheets('statut').Range('B_' & pont).Interior.ColorIndex = 3
End If
Bien que x.Next.Next.Formula soit bien 'Out of Use', il ne passe pas a l'instruction suivante.
Bizarre.
Une idée ? Merci..
La macro suivante fonctionne sans plantage :
Private Sub Worksheet_Activate()
Set p = Sheets('Historique').Range('A2:A65000')
For Each c In p
If c = '' Then Exit Sub
pont = c
GoSub suite
Next c
Exit Sub
suite:
Set n = Sheets('Historique').Range('A2').CurrentRegion
For Each x In n
If pont = x Then
If x.Next.Next.Formula = 'Out of Use' Then
Sheets('statut').Range('B_' & pont).Interior.ColorIndex = 3
End If
End If
Next x
Return
End Sub
Mais dans les lignes
If x.Next.Next.Formula = 'Out of Use' Then
Sheets('statut').Range('B_' & pont).Interior.ColorIndex = 3
End If
Bien que x.Next.Next.Formula soit bien 'Out of Use', il ne passe pas a l'instruction suivante.
Bizarre.
Une idée ? Merci..