ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically adds a row (https://www.excelbanter.com/excel-programming/432690-automatically-adds-row.html)

Tkaklita

Automatically adds a row
 
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?

Jacob Skaria

Automatically adds a row
 
Right click the sheet tabView 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
---------------
Jacob Skaria


"Tkaklita" wrote:

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?


Tkaklita

Automatically adds a row
 
This works fantastic!!! Thank you very much.

"Jacob Skaria" wrote:

Right click the sheet tabView 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
---------------
Jacob Skaria


"Tkaklita" wrote:

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?


Dav1d

Automatically adds a row
 
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!


"Jacob Skaria" wrote:

Right click the sheet tabView 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
---------------
Jacob Skaria


"Tkaklita" wrote:

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?



All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com