Copy x rows y times and then insert customer ID on each set of x rows
Solved/Closed
Y7654
Posts
2
Registration date
Tuesday December 31, 2019
Status
Member
Last seen
December 31, 2019
-
Updated on Dec 31, 2019 at 11:08 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 14, 2020 at 11:44 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 14, 2020 at 11:44 AM
Related:
- Copy x rows y times and then insert customer ID on each set of x rows
- Insert draft watermark in word on all pages - Guide
- How to set time on whatsapp - Guide
- How to set auto redial on android - Guide
- Insert key on laptop - Guide
- Insert check mark in word - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jan 14, 2020 at 11:44 AM
Jan 14, 2020 at 11:44 AM
Hi Y7654,
Give the following code a try:
Best regards,
Trowa
Give the following code a try:
Sub RunMe() Dim lRow, x, nID As Integer lRow = Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Row nID = Sheets("Sheet2").Range("A2:A" & Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row).Rows.Count Sheets("Sheet2").Range("A2:A" & nID + 1).Copy For x = lRow To 2 Step -1 Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Next x For Each cell In Sheets("Sheet3").Range("A2:A" & lRow) cell.Copy For x = nID To 1 Step -1 Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Next x Next cell End Sub
Best regards,
Trowa