Forum Discussion
faire un tri alterné avec soi les nombres plus petits et plus grand ou les couleurs de cellule
Ce texte a été traduit par un logiciel, l'auteur du texte ne parle pas cette langue.
Avec la mise en forme conditionnelle, une formule fonctionnerait également ici :
= MOD (ROW () - 1,1 * 2) +1 <= 1
en français je pense que ce serait :
= MOD (LIGNE () - 1; 1 * 2) +1 <= 1
ou aussi avec VBA :
Sub Marquer_des_lignes()
'ActiveSheet.Unprotect ("")
Dim rng As Range
Dim iStart As Integer, iIntervall As Integer
Dim iCount As Integer, iCounter As Integer
Rows("5:5").Interior.Pattern = xlNone
iStart = 6
iIntervall = 2
iCount = 500
Set rng = Rows(iStart)
For iCounter = iStart To iStart + iCount + iIntervall - 1 Step iIntervall
Set rng = Union(rng, Rows(iCounter))
Next iCounter
rng.Interior.ColorIndex = 6
Set rng = Nothing
'ActiveSheet.Protect ("")
End Sub
Vous pouvez adapter le code VBA à vos besoins
* Fichier d'exemple joint avec les deux options.
Je serais heureux de savoir si je pouvais aider.
NikolinoDE
Je sais que je ne sais rien (Socrate)
La réponse a-t-elle été utile ? Marquez-les comme utiles !
Cela aidera tous les participants au forum.
NikolinoDE Voici mon fichier les information sont dans le message précédant
- NikolinoDEJan 05, 2022Gold Contributor
Unfortunately, I have to admit that there is an error in the code here (I'm slowly doubting whether this is possible with VBA at all), don't know what to do ... the thoughts hang ... too much on the ears ... maybe a VBA specialist can like Mr. Hans Vogelaar (@Hans Vogelaar) (or any other VBA specialist) can help here. I wrote one or two approaches in the VBA editor, but nothing precise that could lead to success could serve as an approach.
Thank you for your understanding and patience
I know I don't know anything (Socrates)