Auto insert row while entering raw data

M

mandapanda625

As I am typing data into Column A, I would like my spreadsheet to
automatically add a row between the typed data and my summary two rows below
(when I press Enter). As a result, I would like two blank rows always
present between these pieces of information. If I cannot have this
automatic, at least a maco would be helpful.

Thanks!
 
G

Gord Dibben

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column > 1 Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value <> "" Then
.Offset(1, 0).EntireRow.Insert
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the code into that sheet module. Alt + q to return to the Excel
window.

Assumes you already have two blank rows betweeb current data and summary row.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top