Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim 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
If CStr(Target) <> "" Then
coul = Target.DisplayFormat.Interior.Color
If coul = vbWhite Then
n2 = n2 + 1
.Cells(2, n2) = Target
Else
n1 = n1 + 1
With .Cells(1, n1)
.Value = Target
.Interior.Color = coul
.Font.Color = Target.DisplayFormat.Font.Color
End With
End If
End If
Next
.CurrentRegion.HorizontalAlignment = xlCenter 'centrage
End With
End Sub
Avec ce fichier (2) le résultat en V6 est stocké vers le bas par la touche <Entrée> :si on peux gader resultats de la partie a etudié a partire de la celulle V6
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
Dim flag As Boolean 'mémorise la variable
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
flag = True
End With
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Not flag Then Exit Sub
Cancel = True
If MsgBox("Stocker le résultat ?", vbYesNo) = vbYes Then _
Range([V6], Cells(6, Columns.Count)).Resize(3).Insert
flag = False 'RAZ
End Sub