MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Changing the order of the columns


Posted by Nicolas on July 27, 2000 2:09 AM

Hi,
1 small question : does anybody know how to change the order of the columns in a XLS worksheet ??
I've got 17 columns and i would like the n°6 to become n°1 and n°4 become n°10 ..... etc

And of couse, i can't do that manually, but with a macro !!!

If someone can help me, that will be very kind.
Thank you
Nicolas


Posted by David on July 27, 0100 3:30 AM

I am sorry but I don't understand the question i think. If you want to move column number 3 click in the column C label do a cut command then
Go to where you want to put it and right click and select the "insert copied cells" Command. Sorry if I am not understanding.

Posted by Ryan on July 27, 0100 12:42 PM

Nicolas,

This will take what is in column E and move it to column A. Hope it's what you need.

Columns("E:E").Selection.Cut Destination:=Columns("A:A")

Ryan