Private Sub Grid_KeyPress(KeyAscii As Integer)
If KeyAscii = 3 Then ‘Touche <Ctrl C>
Dim Sep As String, Tmp As String
Clipboard.Clear
‘————————-Header de la grille
For j = Grid.Col To Grid.ColSel
Tmp = Tmp & Sep & Grid.TextMatrix(0, j)
Sep = vbTab
Next j
Sep = vbCrLf
‘————————-Partie de la grille qui est sélectionnée
For i = Grid.Row To Grid.RowSel
For j = Grid.Col To Grid.ColSel
Tmp = Tmp & Sep & Grid.TextMatrix(i, j)
Sep = vbTab
Next j
If Tmp <> « » Then Tmp = Tmp & vbCrLf
Sep = « »
Next i
End If
Clipboard.SetText Tmp
End Sub