Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim v, n2%, n1%, coul&
Application.ScreenUpdating = False
With [V6]
.CurrentRegion.Clear 'RAZ
Set Target = Intersect(Target, UsedRange)
If Target Is Nothing Then Exit Sub
For Each Target In Target
v = Trim(CStr(Target))
If v <> "" Then
coul = Target.DisplayFormat.Interior.Color
If coul = vbWhite Then
n2 = n2 + 1
.Cells(2, n2) = v
Else
n1 = n1 + 1
With .Cells(1, n1)
.Value = v
.Interior.Color = coul
.Font.Color = Target.DisplayFormat.Font.Color
End With
End If
End If
Next
.CurrentRegion.HorizontalAlignment = xlCenter 'centrage
If Application.CountA([V6:V7]) Then Application.OnKey "~", Me.CodeName & ".Entree"
End With
End Sub
Private Sub Entree()
If MsgBox("Stocker le résultat ?", vbYesNo) = vbYes Then _
Range([V6], Cells(6, Columns.Count)).Resize(3).Insert
Application.OnKey "~" 'RAZ
End Sub