Copy range from one sheet to another skipping rows

henrybrent1974

New Member
Joined
Oct 11, 2017
Messages
19
I'm trying to copy C4 thru C19 from sheet (Sign Up) to sheet (16 Man Bracket) column AC. Need it to start on row 8 then skip a row 3 times then skip 3 rows and repeat until all 16 have been pasted per example below. I used macro recorder to do this but after reading on this forum that isn't the most efficient way of doing this. This will be put in my code to take place of the copy and pasting of each cell one by one.The names are not important just used for example. Thanks in advance for any help.

AC
[TABLE="class: grid, width: 100, align: center"]
<tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ted
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Jen
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Dan
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ben
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ted
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Jen
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Dan
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ben
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ted
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Jen
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Dan
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ben
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ted
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Jen
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Dan
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Ben
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try:
Code:
Sub MoveDataNoBlanks()

    Dim arr()   As Variant
        
    Application.ScreenUpdating = False
        
    With Sheets("Sign Up")
        arr = .Cells(4, 3).Resize(.Cells(.Rows.count, 3).End(xlUp).row - 3).Value
    End With
        
    With Sheets("16 Man Bracket").Cells(.Rows.count, 29).End(xlUp).Offset(1).Resize(UBound(arr, 1), UBound(arr, 2))
        .Value = arr
        .SpecialCells(xlCellTypeBlanks).Delete shift:=xlUp
    End With
    
    Application.ScreenUpdating = True
    
    Erase arr

End Sub
 
Last edited:
Upvote 0
Typo in above, try:
Code:
Sub MoveDataNoBlanks()

    Dim arr()   As Variant
        
    Application.ScreenUpdating = False
        
    With Sheets("Sign Up")
        arr = .Cells(4, 3).Resize(.Cells(.Rows.count, 3).End(xlUp).row - 3).Value
    End With
        
    With Sheets("16 Man Bracket").Cells(Rows.count, 29).End(xlUp).Offset(1).Resize(UBound(arr, 1), UBound(arr, 2))
        .Value = arr
        .SpecialCells(xlCellTypeBlanks).Delete shift:=xlUp
    End With
    
    Application.ScreenUpdating = True
    
    Erase arr

End Sub
 
Last edited:
Upvote 0
Code:
With Sheets("16 Man Bracket").Cells(.Rows.count, 29).End(xlUp).Offset(1).Resize(UBound(arr, 1), UBound(arr, 2))

I'm receiving a compile error invalid or unqualified reference where it says .Rows
 
Upvote 0
Try the code in post #3 , it had an extra . before Rows.Count that needed removing
 
Upvote 0
code runs and pasting in other sheet but it's not skipping like i need. In column AC it should start on row 8 paste name then skip row paste name then skip row paste name then skip row paste name then skip 3 rows paste name then skip row paste name etc.
 
Upvote 0
Try:
Code:
Sub MoveDataNoBlanks()

    Dim arr()   As Variant
    Dim x       As Long
    Dim r       As Long
    Application.ScreenUpdating = False
        
    With Sheets("Sign Up")
        arr = .Cells(4, 3).Resize(.Cells(.Rows.count, 3).End(xlUp).row - 3, 2).Value
    End With
    
    For x = LBound(arr, 1) To UBound(arr, 1)
        arr(x, 2) = 2
        If x Mod 4 = 0 Then arr(x, 2) = 4
    Next x
    
    r = 8
    With Sheets("16 Man Bracket")
        For x = LBound(arr, 1) To UBound(arr, 1)
            .Cells(r, 29).Value = arr(x, 1)
            r = r + arr(x, 2)
        Next x
    End With
    
    Application.ScreenUpdating = True
    
    Erase arr

End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top