Excel VB Copy Paste alternate Row

Dpa24

New Member
Joined
Mar 7, 2019
Messages
2
I have data in even row i would like to copy data from even row and paste into odd row and loop goes to last row of sheet.
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Data1[/TD]
[TD]Data1[/TD]
[TD]Data1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Data2[/TD]
[TD]Data2[/TD]
[TD]Data2[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Data3[/TD]
[TD]Data3[/TD]
[TD]Data3[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Data1[/TD]
[TD]Data1[/TD]
[TD]Data1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Data1[/TD]
[TD]Data1[/TD]
[TD]Data1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Data2[/TD]
[TD]Data2[/TD]
[TD]Data2[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Data2[/TD]
[TD]Data2[/TD]
[TD]Data2[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Data3[/TD]
[TD]Data3[/TD]
[TD]Data3[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Data3[/TD]
[TD]Data3[/TD]
[TD]Data3[/TD]
[/TR]
</tbody>[/TABLE]

****** id="cke_pastebin" style="position: absolute; top: 342px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 500"]
<tbody>[TR]
[TD]Data1[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi & welcome to MrExcel
How about
Code:
Sub Dpa24()
   With Range("A2", Range("A" & Rows.count).End(xlUp).Offset(, 2))
      .SpecialCells(xlBlanks).FormulaR1C1 = "=r[-1]c"
      .Value = .Value
   End With
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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