Move cols to a dynamc place using R1C1

DetroitDavid

Board Regular
Joined
Jul 20, 2013
Messages
211
I import a csv file of data and need to move some columns of information around. Columns A&B always need to go into another place, but the sheet is dynamic in that the number of columns of data changes (if I have more phone numbers, the sheet gets wider to accommodate. So, I can't Move say A:A to Z:Z because I don't know where it should go.

However, I do know how many columns I have via a number, let's say 29. So, in this case if I wanted to move A&B to the forth column from the end (moving the far right 3 over two to create space), I'd like to move A:B to R1C26:R1C27

Can someone give me some direction?

TIA-DD
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try this:

Code:
x = 29
Columns("A:B").Cut Destination:=Columns(x - 3)
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

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