Copy row by x times where value x is cell value of the range
Solved/Closed
                    
        
                    davidang
    
        
                    Posts
            
                
            1
                
                            Registration date
            Thursday February 16, 2017
                            Status
            Member
                            Last seen
            February 16, 2017
            
                -
                            Feb 16, 2017 at 07:49 PM
                        
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - Feb 21, 2017 at 11:59 AM
        TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - Feb 21, 2017 at 11:59 AM
        Related:         
- Insert a new sheet at the end of the tab names and paste the range names starting in cell a1. autofit columns a:b and name the worksheet as named ranges.
 - My contacts list names - Guide
 - Count names in excel - Guide
 - Monk names wow - Guide
 - How to insert at the rate in laptop - Guide
 - Where is the insert key on a laptop - Guide
 
1 response
                
        
                    TrowaD
    
        
                    Posts
            
                
            2921
                
                            Registration date
            Sunday September 12, 2010
                            Status
            Contributor
                            Last seen
            December 27, 2022
            
            
                    555
    
    
                    
Feb 21, 2017 at 10:55 AM
    Feb 21, 2017 at 10:55 AM
                        
                    Hi Davidang,
The following code will work when you call your source sheet "Sheet1" and your destination sheet "Sheet2" or find and change those references in the code.
Here is the code:
Best regards,
Trowa
                
                
            The following code will work when you call your source sheet "Sheet1" and your destination sheet "Sheet2" or find and change those references in the code.
Here is the code:
Sub RunMe()
Dim x As Integer
Sheets("Sheet1").Select
For Each cell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
    x = cell.Value
    cell.EntireRow.Copy
    Sheets("Sheet2").Select
    Do Until x = 0
        Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial
        x = x - 1
    Loop
Next cell
Application.CutCopyMode = False
End Sub
Best regards,
Trowa
        
    
    
    
    
Updated by daveang70 on 21/02/17 at 11:39 AM
I tested it. Yes it works and fulfill my requirement. Thanks a million.
Rgds
David
Feb 21, 2017 at 11:59 AM