Add row when data is entered in a cell, but do not repeat it if the data is edited later

Excelbuddy_7

New Member
Joined
Nov 6, 2015
Messages
26
I have a form, where I have a Worksheet_Change event which adds a new row once data is entered in a particular cell. So my form only has one row, but will keep adding rows as required. When data is entered in cell E12, it copies the current row and pastes it below it, clearing all contents but keeping the same formatting. The code I use:

Code:
If Not Application.Intersect(Target, Range("E12:E112")) Is Nothing Then
On Error Resume Next
Target.EntireRow.Copy
Application.EnableEvents = False
Target.EntireRow.Insert
Target.EntireRow.SpecialCells(xlCellTypeConstants, 23).ClearContents
Target.EntireRow.RowHeight = 15
Application.EnableEvents = True
Application.CutCopyMode = False
End If

Now say, if someone wants to go back and edit the data they typed, or delete it altogether, in cell E12, this inadvertently adds another row as a change was made to the cell. I want to prevent this from happening.

Let me know if you need any more information.

Thanks for any help.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top