Bonjour Lone-wolf et merci de ton accueil et de ta réponse
Je suis content que tu es compris ma macro, j'ai essayé de l'expliquer à l'oral et j'ai failli ne plus la comprendre moi même
Pour ta modification ce que j'avais fait:
Sheets("Graph").Select
'Supprimer erreur ou "t" sur centre de charge "A"
Range("A3").Select
ActiveCell.FormulaR1C1 = "=COUNTA(RC[1]:R[34]C[1])"
x = Range("A3")
For I = 4 To x + 4
If IsError(Range("B" & I)) = True Then
Range("A" & I).ClearContents
Range("C" & I).ClearContents
Range("B" & I).ClearContents
End If
If Range("B" & I) = "t" Then
Range("A" & I).ClearContents
Range("C" & I).ClearContents
Range("B" & I).ClearContents
End If
If Range("B" & I) = "T" Then
Range("A" & I).ClearContents
Range("C" & I).ClearContents
Range("B" & I).ClearContents
End If
Next I
Et je l'ai remplacé par ce que tu m'as donné:
With Sheets("Graph")
derlig = .Range("a" & Rows.Count).End(xlUp).row
.Range("a3").FormulaR1C1 = "=COUNTA(RC[1]:R[34]C[1])"
.Range("D3").FormulaR1C1 = "=COUNTA(RC[1]:R[34]C[1])"
Le reste de code
For i = 4 to 7
If .Range("e" & I) = "t" Or .Range("e" & I) = "T" Then .Range("d4:f7").ClearContents
Next i
.Range("a4:c" & derlig).Sort .Range("b4"), xlAscending
.Range("d4:f" & derlig).Sort .Range("e4"), xlAscending
End With
Mais le problème est qu'il ne supprime pas le contenue de la case où il y a un "t" ou un "T" ou une erreur (#valeur; #ref; #N/0.....). Je dois sans doute faire quelque chose de mal, mais je ne vois pas :'(
Je vous transmet la maquette Excel avec la modification.