Exploitation fonction SET
Bonjour,
voici mon problème, j'ai ce code qui est censé me permettre de retrouver la colonne qui contient en tête "Statut final".
Ensuite je voudrai supprimer toutes les lignes qui ne contiennent pas TOTO dans cette colonne.
Avec le code suivant, j'ai un message d'erreur "référence incorrecte ou non qualifiée.."
Avez-vous une idée? un GRAND merci pour votre aide,
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Sub Col_Select()
Dim Cel As Range
Set Cel = Cells.Find(what:="Statut final*")
If Not Cel Is Nothing Then
For i = .Range("A" & .Rows.Count).End(xlUp).Row To 3 Step -1
If .Range(Cel.Column & i).Value <> "TOTO" Then
.Rows(i).Delete
End If
Next i
End If
End Sub |