anthoYS
XLDnaute Barbatruc
Bonsoir à tous.
Comment faire pour que ces deux codes soient executables dans la même feuille?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
If Not Application.Intersect(Target, [E3:J10]) Is Nothing Then Target.Interior.ColorIndex = IIf(Target.Interior.ColorIndex = 4, xlNone, 4)
If Target.Column = 4 Then
Cells(Target.Row, 4) = Date
End If
If Target.Column = 11 Then
Cells(Target.Row, 11) = Date
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim c As Long, i As Long
If Intersect(Target, Range("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
Merci par avance.
Comment faire pour que ces deux codes soient executables dans la même feuille?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
If Not Application.Intersect(Target, [E3:J10]) Is Nothing Then Target.Interior.ColorIndex = IIf(Target.Interior.ColorIndex = 4, xlNone, 4)
If Target.Column = 4 Then
Cells(Target.Row, 4) = Date
End If
If Target.Column = 11 Then
Cells(Target.Row, 11) = Date
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim c As Long, i As Long
If Intersect(Target, Range("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
Merci par avance.