Help Needed?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do i insert row automatically after hitting enter at the end of data entry?
 
right click on sheet tab>view code>insert this>save.
Now, when you enter anything in column F (6) a row will be inserted

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then Target.EntireRow.Insert
End Sub


--
Don Guillett
SalesAid Software
(e-mail address removed)
Ali said:
how do i insert row automatically after hitting enter at the end of data
entry?
 
And another version based on Don's:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
Target(1).Offset(1, 0).EntireRow.Insert
End If
End Sub

This inserts after the cell you changed
 
or
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then Rows(Target.Row + 1).Insert
End Sub
 

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

Back
Top