Private Sub Form_Load()
Dim matrix(1 To 4, 1 To 2) As Single
Dim r As Integer
Dim c As Integer
For r = 1 To UBound(matrix, 1)
For c = 1 To UBound(matrix, 2)
matrix(r, c) = Rnd * 100
Next c
Next r
MSFlexGrid1.Rows = UBound(matrix, 1)
MSFlexGrid1.Cols = UBound(matrix, 2)
MSFlexGrid1.FixedCols = 0
MSFlexGrid1.FixedRows = 0
For r = 1 To UBound(matrix, 1)
For c = 1 To UBound(matrix, 2)
MSFlexGrid1.TextMatrix(r - 1, c - 1) = _
Format$(matrix(r, c), "0.00")
Next c
Next r
End Sub
|