Hello All,
I have a table with the headings in row 11 (A11:J11) and I want to be able to copy row 12 and paste a blank copy of this row below the headings so that as data is entered there will always be a blank row below the heading row. All new data will therefore be entered in the row below the heading row.
As the rows below the headings have data validation and conditional formatting applied I thought it was probably easier to copy a row and delete any data that may be within the inserted row.
This is what I would like the Worksheet Change macro to be able to do:
- Data is entered into cell A12 which would trigger the Worksheet Change macro
- This event would copy row 12 and insert a copy of the row above the current row 12.
- Any data in cells A12:J12 would be deleted
- Any borders applied would be maintained (i.e. not copy the borders of the heading row)
- After the blank row has been inserted the next selected cell for more data entry would be B13
I hope this make sense...
I have found various macros, but I am having trouble modifying them to become Worksheet Change
Sub InsertCopyRow2()
'http://excel.tips.net/T002042_Inserting_and_Copying_Rows.html
ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).EntireRow
End Sub
Sub InsertAtRow12()
'http://chandoo.org/forums/topic/macro-that-copies-a-cell-range-and-pastes-it-on-the-next-empty-row-it-finds
Range("A12:J12").Select
Selection.Copy
Rows("12:12").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
End Sub
Any help or suggestions would be appreciated
Regards,
Dave T