Macro to add # of rows based on data in the sheet
Closed
ardale
Posts
2
Registration date
Friday May 24, 2013
Status
Member
Last seen
June 11, 2013
-
May 24, 2013 at 01:02 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 13, 2013 at 10:40 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 13, 2013 at 10:40 AM
Related:
- Macro to add # of rows based on data in the sheet
- 2007 microsoft office add-in microsoft save as pdf or xps - Download - Other
- How to add @ in laptop - Guide
- Excel macro to create new sheet based on value in cells - Guide
- Sheet right to left in google sheet - Guide
- How to add songs to sound picker - Guide
3 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jun 1, 2013 at 06:24 PM
Jun 1, 2013 at 06:24 PM
could you post a sample book at some public file share site and post back link to the posted file back here and re explain what you seek ?
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jun 10, 2013 at 11:28 AM
Jun 10, 2013 at 11:28 AM
Hi Ardale,
Here you go:
Best regards,
Trowa
Here you go:
Sub test() Dim x, y, cRow As Integer cRow = 1 Do If Range("B" & cRow).Value > 1 Then x = Range("B" & cRow).Value y = Range("B" & cRow).Value Do Range("A" & cRow + 1).EntireRow.Insert Shift:=xlUp Range("A" & cRow).Copy Range("A" & cRow + 1) x = x - 1 Loop Until x = 1 cRow = cRow + y End If Loop Until Range("A" & cRow).Value = vbNullString End Sub
Best regards,
Trowa
ardale
Posts
2
Registration date
Friday May 24, 2013
Status
Member
Last seen
June 11, 2013
Jun 11, 2013 at 10:24 PM
Jun 11, 2013 at 10:24 PM
Thank you so much. I tried it and I get an error when it runs. Is there somewhere that I can send you a sample copy of the file so that you can see what the error is?
Thanks,
A
Thanks,
A
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jun 13, 2013 at 10:40 AM
Jun 13, 2013 at 10:40 AM
Sure, you can google "filesharing site" or give these two a try:
www.speedyshare.com
ge.tt
Post back the download link provided by the site of your choise.
Also provide the code line that produces the error.
Best regards,
Trowa
www.speedyshare.com
ge.tt
Post back the download link provided by the site of your choise.
Also provide the code line that produces the error.
Best regards,
Trowa