# How to copy and paste rows into alternate starting columns

#### Jiriyanu

##### New Member
Hi all,

I'm trying to prepare data for import and the software requires me to use two sets of headers in order to import 2 sets of data into one page (2 forms in one page, think tax forms). Problem is I have clients that have over 50 people that need to each have forms.

Basically, I'd like to have all odd rows (A7:Z7, A9:Z9, etc) of sheet A to be pasted starting at A2 of sheet B, and all even rows (A8:Z8, A10:Z10, etc) to be pasted starting at AA2 of sheet B.

Honestly I'm not sure where to start with this coding. I'm still very much a beginner.

Any and all help is appreciated. Thank you!

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### Fluff

##### MrExcel MVP, Moderator
VBA Code:
``````Sub Jiriyanu()
Dim UsdRws As Long
Dim Orws As Variant, Erws As Variant, Oary As Variant, Eary As Variant

With Sheets("Sheet1")
UsdRws = .Range("A" & Rows.Count).End(xlUp).Row

Orws = Application.Transpose(Filter(Evaluate("Transpose(if(isodd(row(7:" & UsdRws & ")),row(7:" & UsdRws & "),""x""))"), "x", False))
Erws = Application.Transpose(Filter(Evaluate("Transpose(if(iseven(row(7:" & UsdRws & ")),row(7:" & UsdRws & "),""x""))"), "x", False))
Oary = Application.Index(.Range("A1:Z" & UsdRws).Value, Orws, Evaluate("column(A:Z)"))
Eary = Application.Index(.Range("A1:Z" & UsdRws).Value, Erws, Evaluate("column(A:Z)"))
End With
With Sheets("Sheet2")
.Range("A2").Resize(UBound(Oary), 26).Value = Oary
.Range("AA2").Resize(UBound(Eary), 26).Value = Eary
End With
End Sub``````

#### Jiriyanu

##### New Member
VBA Code:
``````Sub Jiriyanu()
Dim UsdRws As Long
Dim Orws As Variant, Erws As Variant, Oary As Variant, Eary As Variant

With Sheets("Sheet1")
UsdRws = .Range("A" & Rows.Count).End(xlUp).Row

Orws = Application.Transpose(Filter(Evaluate("Transpose(if(isodd(row(7:" & UsdRws & ")),row(7:" & UsdRws & "),""x""))"), "x", False))
Erws = Application.Transpose(Filter(Evaluate("Transpose(if(iseven(row(7:" & UsdRws & ")),row(7:" & UsdRws & "),""x""))"), "x", False))
Oary = Application.Index(.Range("A1:Z" & UsdRws).Value, Orws, Evaluate("column(A:Z)"))
Eary = Application.Index(.Range("A1:Z" & UsdRws).Value, Erws, Evaluate("column(A:Z)"))
End With
With Sheets("Sheet2")
.Range("A2").Resize(UBound(Oary), 26).Value = Oary
.Range("AA2").Resize(UBound(Eary), 26).Value = Eary
End With
End Sub``````
Thank you so much, Fluff! This worked perfectly with no errors.

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Replies
0
Views
124
Replies
6
Views
80
Replies
5
Views
89
Replies
1
Views
49
Replies
1
Views
159

1,130,157
Messages
5,640,460
Members
417,143
Latest member

### 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.

### Which adblocker are you using?

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

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