VB Code:
Public Sub InsertRow(msf As MSFlexGrid, row As Integer) Dim intRow As Integer Dim intCol As Integer ' Move the rows down For intRow = MSFlexGrid1.Rows - 1 To row Step -1 For intCol = 0 To MSFlexGrid1.Cols - 1 MSFlexGrid1.TextMatrix(intRow, intCol) = MSFlexGrid1.TextMatrix(intRow - 1, intCol) Next Next ' Blank the row For intCol = 0 To MSFlexGrid1.Cols - 1 MSFlexGrid1.TextMatrix(row, intCol) = "" Next End Sub
Usage:
InsertRow MSFlexGrid1, 5




Reply With Quote