Copy row and insert based on value in column
Closed
smittyxsmith
-
Jan 25, 2022 at 12:43 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Feb 7, 2022 at 12:03 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Feb 7, 2022 at 12:03 PM
Related:
- Copy row and insert based on value in column
- Disk boot failure insert system disk and press enter - Guide
- Excel macro to create new sheet based on value in cells - Guide
- How to insert photo in word for resume - Guide
- Auto serial number in excel based on another column ✓ - Excel Forum
- Macro to insert row in excel based on criteria - Excel Forum
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
549
Updated on Feb 7, 2022 at 12:04 PM
Updated on Feb 7, 2022 at 12:04 PM
Hi Smittyxsmith,
Here is your macro code:
Best regards,
Trowa
Here is your macro code:
Sub RunMe() Dim x, y, lRow As Integer lRow = Range("J" & Rows.Count).End(xlUp).Row For x = lRow To 1 Step -1 y = Cells(x, "J") Do 'For the bonus points adjust the column letters A and J to determine the columns to be copied. With Range(Cells(x, "A"), Cells(x, "J")) .Copy .Insert Shift:=xlDown End With y = y - 1 Loop Until y = 0 Next x End Sub
Best regards,
Trowa