Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim coul%, tablo As Range, lig&, col%
coul = Target(1).Interior.ColorIndex
If coul = xlNone Or coul = 2 Then Exit Sub
For col = Target.Column To 1 Step -1
If col = 1 Then Exit For
If Cells(Target.Row, col).Interior.ColorIndex <> coul Then col = col + 1: Exit For
Next
Set tablo = Cells(Target.Row, col).CurrentRegion
lig = tablo.Row '1ère ligne
col = tablo(tablo.Columns.Count).Column 'dernière colonne
If Target.Row = lig Then
With Shapes("Bouton 2") 'nom à adapter
.Left = Cells(lig, col).Left + (Cells(lig, col).Width - .Width) / 2
.Top = Cells(lig, col).Top + (Cells(lig, col).Height - .Height) / 2
End With
ElseIf Target.Column = col And Target.Row > lig + 1 Then
If tablo(Target.Row - tablo.Row + 1, 2) = "" Then Exit Sub 'si aucun nom
Target(1) = IIf(Target(1) = "", "x", "")
tablo(1).Select
End If
End Sub