Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rc&, v As Range, col%, h&
Application.ScreenUpdating = False
With [B3:Q18]
[A1].Copy .Cells 'copie A1 avec ses bordures
rc = .Rows.Count
Set v = .Rows(rc + 2).Cells 'ligne des valeurs
For col = 1 To .Columns.Count
h = rc - Int(Abs(Val(v(col))))
If h Then
With .Cells(1, col).Resize(h)
.Interior.ColorIndex = xlNone
.Borders.Weight = xlThin
.Borders.ColorIndex = 15 'gris
End With
End If
Next
End With
End Sub