Randomize; For i := 0 to StringGrid1.ColCount-1 do For j := 0 to StringGrid1.RowCount-1 do StringGrid1.Cells[i,j] := IntToStr(Random(100));