Moving selected data one column

DaveUK

Board Regular
Joined
Jan 24, 2005
Messages
245
I am using this code to select a range going down a variable amount of rows.

Sub MoveRunningTotalColumn()
Range("A4").End(xlToRight).Offset(0, 2).Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
End Sub

What i want to do is cut the data in the range (and keep the formatting) and move all the data to the same row position but one column to the right.
There is always data in Row 4 which is why i used End(xlToRight).

Please can someone tell me how to do this.

TIA
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You can do it this way:
Code:
    Range(Range("A65536").End(xlUp), Range("A4").End(xlToRight)).Cut Range("B4")

As long as there's data in column A in the last row, and in A4 it will work. You could try using UsedRange, as well.

To just cut (or copy) you usually only need one line of code per range. Just supply the destination on the same line. Hope that helps!
 
Upvote 0
Mmmm!!

I don't think i have made it too clear.

The Data isn't actually in column A that i want to copy, it is offset 2 columns from the end of the row which starts at cell A4. Data itself can be a variable amount of cells down from this offset cell.

A an initial start the column i need to move is already at column G !! So i need to move it across to column H, initially.
 
Upvote 0

Forum statistics

Threads
1,203,198
Messages
6,054,073
Members
444,701
Latest member
PTDykman

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