Bonjour Aurelie, le Forum
Voici donc une macro évènementielle à mettre dans le Private Module de la Feuille en question.
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Plage As String, Cell As Range
Dim TheColorIndex As Byte
If Selection.Interior.ColorIndex = xlNone Then Exit Sub
TheColorIndex = Target.Interior.ColorIndex
Application.EnableEvents = False
For Each Cell In UsedRange
If Cell.Interior.ColorIndex = TheColorIndex Then
Plage = Plage & Cell.Address(0, 0) & ","
End If
Next
Plage = Left(Plage, Len(Plage) - 1)
Range(Plage).Select
Application.EnableEvents = True
End Sub
Etant donné l'usage de "Application.EnableEvents" , je te donne aussi une Remise à Zéro, en cas de plantage pour permettre de réactiver les macro évènememtielles en cas de plantage, sans à avoir à redémarrer Excel.
Sub RAZ()
Application.EnableEvents = True
End Sub
Bon Dimanche
@+Thierry