Automate insertion of row data

MrJJP

New Member
Joined
Sep 9, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello, would like to automatically add certain row data when data in other cells is added. In the below screenshot I have unchanging data in columns B & C, with the expectation that users will input data into the respective columns D, E & F. So my starting point in the example is B2:F5, and I would like it to come out to looking like the example in B8:F13. Another way to say this, is in B8:F13, if a user input the data into D8, E8, and/or F8, upon hitting enter, it would create a new row underneath it with blanks (ready for the next user's input) into D9:F9, but still copy/retain the original data values from B8 and C8. I'd prefer to do it without VBA, but can muster through that with any additional help (my total number of rows will be around 35 and I may have 3-4 additional columns). Thanks for any help!

1725913926851.png
 
I hope I've understood correctly. If so I think this fixes the issue.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim cRow As Long
    If Intersect(Target, Range("F3:F40")) Is Nothing Or Target.Columns.Count > 1 Then Exit Sub
    Application.EnableEvents = False
    cRow = Target.Row
    Rows(cRow + 1 & ":" & cRow + 1).Insert Shift:=xlDown
    Range("B" & cRow & ":D" & cRow).Copy Range("B" & cRow + 1 & ":D" & cRow + 1)
    Application.CutCopyMode = False
    Application.EnableEvents = True
End Sub
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hooray! I really think that nailed it, I've been running through the sheet multiple times with varying edits to make sure I didn't leave anything out or have any further issues. Thanks again for sharing your expertise and of course the VBA code!
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,996
Members
452,542
Latest member
Bricklin

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