Je m'y suis pris ainsi pour faire apparaître 1 (et colorer la cellule ne vert) lorsqu'on double clique
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim row%, col%, Cible As Variant
Set lf = Worksheets("Listing flore")
lrlf = lf.Cells(Rows.Count, 2).End(xlUp).row
lclf = lf.Cells(1, lf.Columns.Count).End(xlToLeft).Column
If Not Application.Intersect(Target, Range("B2:B" & lrlf)) Is Nothing Then
row = Target.row
col = Target.Column
Cells(row, col - 1) = c & "+"
Cells(row, col - 1).Interior.ColorIndex = 4 'Cells(row, col - 1)
Cancel = True
End If
End Sub
Je peux me baser là dessus pour exécuter le reste du code, et ça devient très clairement plus simple !
Bon par contre je ne sais pas faire apparaître une "Coche" !
Edit : Maj, c'est bon !
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim row%, col%, Cible As Variant
Set lf = Worksheets("Listing flore")
lrlf = lf.Cells(Rows.Count, 2).End(xlUp).row
lclf = lf.Cells(1, lf.Columns.Count).End(xlToLeft).Column
If Not Application.Intersect(Target, Range("B2:B" & lrlf)) Is Nothing Then
row = Target.row
col = Target.Column
Cells(row, col - 1).Font.ColorIndex = 2
Cells(row, col - 1) = 1
With Cells(row, col - 1).FormatConditions(1)
.ReverseOrder = False
.ShowIconOnly = False
.IconSet = ActiveWorkbook.IconSets(xl3Symbols2)
End With
Cancel = True
End If
End Sub