Dim ligne As Integer
ligne = 3
MSFlexGrid1.ForeColorSel = vbRed
MSFlexGrid1.BackColorSel = vbBlue
MSFlexGrid1.Row = ligne - 1
MSFlexGrid1.RowSel = ligne
Dim ligne As Integer, colonne As Integer
ligne = 2
colonne = 0
MSFlexGrid1.Row = ligne
MSFlexGrid1.Col = colonne
MSFlexGrid1.CellBackColor = vbYellow
MSFlexGrid1.CellForeColor = vbRed
Private Sub peindre(quoi As MSFlexGrid, ligne As Integer, coulfond As Long, coulcar As Long)
With quoi
For i = 0 To .Cols - 1
.Row = ligne: .Col = i
.CellBackColor = coulfond: .CellForeColor = coulcar
Next
End With
End Sub
peindre MSFlexGrid1, 2, vbYellow, vbRed