Bonjour à toutes et à tous.

J'ai deux vba qui fonctionne bien dans deux classeurS différents mais quand je veux les mettre dans le même classeur, elle ne marche plus. Merci pour votre aide

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("I4:AE4,I14:AE14")) Is Nothing Then
 
With Target.Interior
If .Pattern = xlUp Then
.Pattern = xlNone
Else
.PatternColorIndex = 44
.Pattern = xlUp
End If
End With
 
End If
End Sub

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("J6:L6")) Is Nothing Then
With Target
If Selection.Interior.ColorIndex = 48 Then
Selection.Interior.ColorIndex = xlNone
Else
Selection.Interior.ColorIndex = 48
End If
End With
End If
End Sub