Mise en forme conditionnelle et tri

Résolu
Bonjour,

Est-ce possible de faire un tri lorsqu’on fait une MFC ? Par exemple, j’ai plusieurs colonnes et ds une d’elles, j’ai le nom de certaines villes qui sont en rouge; est-ce possible de faire le tri par les cellules ROUGES

3 réponses

  1. Hello
    Oui c'est possible.
    http://www.excelabo.net/excel/conditionformat.php#couleurdeMEFC
    Cordialement
    0
    1. merci malheureusement je ne peux ouvrir votre fichier. J’obtiens le message

      404 NOT FOUND
      The resource requested could not be found on this server

      pouvez-vs le sauvegarder ds
      https://www.cjoint.com/c/GECcEaOYqiB
      0
    2. plus simple :

      Onglet Trier

      Choisir Trier Par.. la colonne VILLE.
      Choisir Trier Couleur de cellule
      Dans Ordre Choisir Couleur
      cliquer sur OK
      0
  2. sub TriCoul(R As Range)
    Dim Bas As Long, Haut As Long
    Dim Col As Integer
    Dim i As Long, j As Long
    Dim Milieu As Variant, Echange As Variant
    Col = R.Column
    Bas = R.Row
    Haut = R.Rows.Count + i - 1
    i = Bas
    j = Haut
    Milieu = Cells((Int(Bas + Haut) / 2), Col).Interior.Color
    Do
    While Cells(i, Col).Interior.Color i = i + 1
    Wend
    While Milieu j = j - 1
    Wend
    If i Echange = Cells(i, Col).Interior.Color
    Cells(i, Col).Interior.Color = Cells(j, Col).Interior.Color
    Cells(j, Col).Interior.Color = Echange
    Echange = Cells(i, Col).Value
    Cells(i, Col).Value = Cells(j, Col).Value
    Cells(j, Col).Value = Echange
    i = i + 1
    j = j - 1
    End If
    Loop Until i > j
    If Bas If i end sub

    sub TriCoulRange()
    TriCoul Selection
    end sub
    0
    1. Contributeur
      Oui, c'est possible et très facile. Cela fait partie des options de tri.
      0
      1. super !
        merci beaucoup
        0