Hi All,
I have sheet which includes an area with several columns where data is entered. Above the data entry area there is text / a header. Immediately below there is a blank line. Below that blank line is the header for the next section.
When opening the file there are initially 20 data entry rows, rows 14 to 33. The blank line is row 34.
Column A is blank and in the data entry area column B is a sequential line number (initially 1 - 20).
I need a macro (triggered by the worksheet change event) which, when the last row is reached will add a row underneath.
So far I've come up with;
Although the first thing that does is correct (adding a new row) it loops and continues adding rows until I stop the macro.
Could anybody please point me towards how I can get it to add only a single row but, when I then move into that new row it will add another below, etc, etc.
Many thanks in advance!!
Richard
I have sheet which includes an area with several columns where data is entered. Above the data entry area there is text / a header. Immediately below there is a blank line. Below that blank line is the header for the next section.
When opening the file there are initially 20 data entry rows, rows 14 to 33. The blank line is row 34.
Column A is blank and in the data entry area column B is a sequential line number (initially 1 - 20).
I need a macro (triggered by the worksheet change event) which, when the last row is reached will add a row underneath.
So far I've come up with;
Code:
If Range("B14").End(xlDown).Row = ActiveCell.Row Then
Rows(ActiveCell.Row).Select
Selection.Copy
Rows(ActiveCell.Row + 1).Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(rowOffset:=-1, columnOffset:=2).Activate
End If
Although the first thing that does is correct (adding a new row) it loops and continues adding rows until I stop the macro.
Could anybody please point me towards how I can get it to add only a single row but, when I then move into that new row it will add another below, etc, etc.
Many thanks in advance!!
Richard