Coloration verte après un double clic, rouge après deux

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

anthoYS

XLDnaute Barbatruc
bonjour,

j'ai un soucis avec un code.

Code:
[COLOR="Yellow"]Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)[/COLOR]
    Dim c As Long, i As Long
    If Intersect(Target, Union([Felkig])) Is Nothing Then Exit Sub
    c = Target.Interior.ColorIndex
    For i = 1 To Range("palette").Count
        If Range("palette").Cells(i, 1).Interior.ColorIndex = c Then
            Target.Interior.ColorIndex = Range("palette").Cells(i + 1, 1).Interior.ColorIndex
            Target.Font.ColorIndex = Range("palette").Cells(i + 1, 1).Font.ColorIndex
            i = Range("palette").Count
            Cancel = True
        End If
    Next i
End Sub

voir le fichier joint😕
 

Pièces jointes

- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
5
Affichages
915
  • Question Question
Microsoft 365 worksheet_change
Réponses
29
Affichages
1 K
Réponses
4
Affichages
735
Retour