Forum Discussion
Diane1970
Apr 11, 2023Copper Contributor
Inserting Multiple rows after each change in data
Morning, trying to insert 25 rows after each change in data i.e. employee #
1 Reply
- OliverScheurichGold Contributor
Sub insert() Dim i As Long Dim k As Integer For i = 2 To 10000 If Cells(i + 1, 1).Value <> Cells(i, 1).Value Then For k = i + 1 To i + 25 Rows(k).insert Next k i = k - 1 Else End If Next i End SubMaybe with these lines of code. In the attached file you can click the button in cell C1 to run the macro.