Macro to copy paste info from every other cell

ljuarez

New Member
Joined
Apr 17, 2014
Messages
4
I have a table like this:
1/2/14
2345
1/6/14
34665
1/7/14
5473457

<tbody>
</tbody>

For Column A-I would like to create a macro that will copy the info from cell A1 and paste in in A2. This will continue all the way to the last row containing info which will vary. So after the first copy/paste, it well go to A3 and copy paste onto A4, A5 will copy and paste onto A6 etc.

For Column B- The same only it will copy the contents of B2 and paste it on B1, B4 copy/paste to B3 all the way until the last row of data.

Thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
hi ljuarez
try the following code and see if its what you need

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim a, b As Variant
x = Range("a" & Rows.Count).End(xlUp).Row
Do
a = a + 1: b = b + 2
Range("a" & b) = Range("a" & a)
Range("b" & a) = Range("b" & b)

a = a + 1
If b > x Then Exit Sub
Loop
End Sub

good luck

kevin
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,245
Members
448,952
Latest member
kjurney

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