1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Lig As Long
Lig = ActiveCell.Row
If Cells(Lig, 10).Interior.ColorIndex = 2 Then 'Test si fond blanc = 2
Cells(Lig, 11) = Cells(Lig, 10) 'Récupèrer la valeur et somme
Cells(Lig, 10) = "Valider" 'Message valider colonne J N°10
With Range(Cells(Lig, 1), Cells(Lig, 10))
.Interior.ColorIndex = 16
With .Characters(1, 1).Font
.ColorIndex = 6 'Couleur noire
.Bold = False 'Non gras
End With
With .Characters(1, 1).Font
.ColorIndex = 3 'V en rouge
.Bold = True 'V en gras
End With
End With
ElseIf Cells(Lig, 10).Interior.ColorIndex = 16 Then 'Barre gris fonçé 16
Range(Cells(Lig, 1), Cells(Lig, 10)).Interior.ColorIndex = 2 'Test si fond = 2
Cells(Lig, 10) = Cells(Lig, 11) 'Replace la somme
Cells(Lig, 11) = "" 'Efface cellule colonne K
With Range(Cells(Lig, 1), Cells(Lig, 10))
.Interior.ColorIndex = 2
With .Characters(1, 1).Font
.ColorIndex = 1 'V en rouge
.Bold = False 'V en gras
End With
End With
End If
End Sub |