HI. So now I am looking for the correct code to do the following (I am only using a portion of the code).
I would like to be able to insert a new row below the already input data. For my code:
lRow enters the subroutine with a value of 15 { this means the last row of data is on row 15}
I am looking to insert a row below this one so I can add more data. As the user continues, the counter (lRow) will increase each time this subroutine is called, and continue to insert the next row below the previously used on. {for clearer, I have data in row 15 and 16. The user needs to add more data, so the subroutine will add a new row row 17, and the user can input data. This will continue until the user is done.
The code I am looking for will be how to call the correct row (last used), add 1 to it, and insert that row.
Sub cmdEnterMore_Click()
'
' InsertRow
'
lRow = lRow + 1
'
Range("A" + lRow, "J" + lRow).Select
Selection.EntireRow.Insert
Range("A" + lRow, "J" + lRow).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("A" + lRow, "J" + lRow).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
end sub
Bookmarks