Automatically adds a row

T

Tkaklita

Is it possible to create a program that will automatically add a row above
the row you are entering information on so that each row of info keeps moving
downwards?
 
J

Jacob Skaria

Right click the sheet tab>View code and Paste the below code...and try
entering values in Column A...Adjust to suit...Try and feedback

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A:A")) Is Nothing Then
Rows(Target.Row).Insert: Target.Offset(-1, 0).Select
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
 
T

Tkaklita

This works fantastic!!! Thank you very much.

Jacob Skaria said:
Right click the sheet tab>View code and Paste the below code...and try
entering values in Column A...Adjust to suit...Try and feedback

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A:A")) Is Nothing Then
Rows(Target.Row).Insert: Target.Offset(-1, 0).Select
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
 
D

Dav1d

This was fabulous, thank you so much for posting it.

Can anyone guide me on what would need to be added to the code to retain the
formatting (merged cells) and the formulas in some of the cells (If, thens)

What a great community this is!
 
Top