用MSHFlexGri外觀會更漂亮些 Private Sub CommandButton1_Click() MSHFlexGrid1.Cols = 5 MSHFlexGrid1.Rows = 9 MSHFlexGrid1.ColWidth(0) = 12 * 25 * 1.2 MSHFlexGrid1.ColWidth(1) = 12 * 25 * 5 MSHFlexGrid1.ColWidth(2) = 12 * 25 * 5 MSHFlexGrid1.ColWidth(3) = 12 * 25 * 5 MSHFlexGrid1.ColWidth(4) = 12 * 25 * 5 On Error Resume Next MSHFlexGrid1.FixedRows = 1 MSHFlexGrid1.FixedCols = 1 MSHFlexGrid1.TextMatrix(0, 0) = "NO" MSHFlexGrid1.TextMatrix(0, 1) = "項目1" MSHFlexGrid1.TextMatrix(0, 2) = "項目2" MSHFlexGrid1.TextMatrix(0, 3) = "項目3" MSHFlexGrid1.TextMatrix(0, 4) = "項目4" For i = 2 To 10 MSHFlexGrid1.TextMatrix(i - 1, 0) = i - 1 MSHFlexGrid1.TextMatrix(i - 1, 1) = Cells(i, 1) MSHFlexGrid1.TextMatrix(i - 1, 2) = Cells(i, 2) MSHFlexGrid1.TextMatrix(i - 1, 3) = Cells(i, 3) MSHFlexGrid1.TextMatrix(i - 1, 4) = Cells(i, 4) Next End Sub
[此贴子已经被作者于2006-12-14 13:36:15编辑过] |