Forum Discussion
Corder
Mar 28, 2022Copper Contributor
Formula to Duplicate Entire Rows Based on Cell Value
Hello everyone! I'm trying to create a formula that will duplicate an entire row based on a cell's value. Below is a mock photo of what I am hoping to accomplish: The formula would g...
- Mar 28, 2022
Sub companyemployees() Dim i As Double Dim j As Double Dim z As Double Dim w As Double For i = 2 To 1000 j = Cells(i, 2).Value For z = 2 To j + 1 Cells(z + w, 4).Value = Cells(i, 1).Value Cells(z + w, 5).Value = Cells(i, 2).Value Next z w = w + z - 2 Next i End SubMaybe with these lines of VBA code. Click the button in cell G2 in the attached file to start the macro.
Corder
Mar 29, 2022Copper Contributor
No worries,
I appreciate the help greatly!
I appreciate the help greatly!
MCasey3071
Nov 22, 2024Copper Contributor
Just seen this as I was stuck, I found a a great Software named EasyDataTransform which makes this so simple