How do I cut and paste data from last row on excel sheet, then loop?

kcheeser

New Member
Joined
Sep 19, 2013
Messages
5
I have an excel worksheet that has data in columns BA:CX. I want VBA to cut the data from the last row in the worksheet BA:CX and paste the data in the row below it's current location starting with column C:AY. I want to repeat the process for the next row up, etc. all the way until I get to BA:CX in row 2.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Do you mean say cut BA:CX on row 45 and paste in C:AY on row 46 and repeat same for BA:CX on row 44 and paste in C:AY on 45 and so on

Only challenge is that BA:CX and C:AY are not same size, so what am I missing?
 
Upvote 0
Sorry, cut from BA:CY, paste in B:AZ . Plus the data is every other line. So if row 45 is the last row of data, cut BA45:CY45. Paste B46:AZ46. Then move to row 43. Cut BA43:CX43, paste in B44:AZ44. The last row of data will vary, so I need the code to find the last row.
 
Upvote 0
Something like this

Code:
Sub cutpaste()
    lastrow = Range("BA" & Rows.Count).End(xlUp).Row
    
    For I = lastrow To 1 Step -2
        Range("BA" & I & ":" & "CZ" & I).Cut Range("A" & I + 1 & ":" & "AZ" & I + 1)
    Next I
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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