Insert Rows according cells value in excel table
Closed
loftier
Posts
1
Registration date
Friday June 7, 2013
Status
Member
Last seen
June 7, 2013
-
Jun 7, 2013 at 02:39 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Jun 10, 2013 at 11:21 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Jun 10, 2013 at 11:21 AM
Related:
- Insert Rows according cells value in excel table
- Excel date format dd.mm.yyyy - Guide
- Excel macro to create new sheet based on value in cells - Guide
- Screenshot in excel - Guide
- Insert file path in excel - Guide
- School time table software in excel free download - Download - Organisation and teamwork
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
549
Jun 10, 2013 at 11:21 AM
Jun 10, 2013 at 11:21 AM
Hi Loftier,
Here you go:
Best regards,
Trowa
Here you go:
Sub test() Dim x, y, cRow As Integer cRow = 1 Do If Range("A" & cRow).Value > 1 Then x = Range("A" & cRow).Value y = Range("A" & cRow).Value Do Range("A" & cRow + 1).EntireRow.Insert Shift:=xlUp Range(Cells(cRow, "A"), Cells(cRow, "B")).Copy Range("A" & cRow + 1).PasteSpecial x = x - 1 Loop Until x = 1 cRow = cRow + y End If Loop Until Range("A" & cRow).Value = vbNullString Application.CutCopyMode = False End Sub
Best regards,
Trowa