Copy row and it's contents based on value in X cell.
Closed
vmvmvmdew
Posts
1
Registration date
Wednesday January 25, 2017
Status
Member
Last seen
January 25, 2017
-
Updated by Ambucias on 25/01/17 at 05:09 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 26, 2017 at 11:40 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 26, 2017 at 11:40 AM
Related:
- Based on the values in cells b77:b81
- Excel macro to create new sheet based on value in cells - Guide
- We couldn't find an account matching the login info you entered, but found an account that closely matches based on your login history ✓ - Facebook Forum
- Compare 2 text cells and show difference in the third cell ✓ - Excel Forum
- Conversion of values already present in cells ✓ - Excel Forum
- Auto serial number in excel based on another column ✓ - Excel Forum
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Jan 26, 2017 at 11:40 AM
Jan 26, 2017 at 11:40 AM
Hi vmvmvmdew,
Welcome to the forum!
You explained well, although your mini table doesn't make much sense if it just subtracts one. Why not use formula in I11: =H11-1?
Give the code below a try and see if it yields the desired result:
Best regards,
Trowa
Welcome to the forum!
You explained well, although your mini table doesn't make much sense if it just subtracts one. Why not use formula in I11: =H11-1?
Give the code below a try and see if it yields the desired result:
Sub RunMe() Dim x, y, z As Integer y = 11 Do Until Range("I" & y) = vbNullString x = Range("I" & y).Value z = x Do Until x = 0 Rows(y).Copy Rows(y).Insert shift:=xlUp x = x - 1 Loop y = y + z + 1 Loop Application.CutCopyMode = False End Sub
Best regards,
Trowa